Hello Huayang Duan, build bot (Jenkins), Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40404
to look at the new patch set (#5).
Change subject: mmio: Fix failure in bit field macro when accessing >30 bits ......................................................................
mmio: Fix failure in bit field macro when accessing >30 bits
For bit fields with 31 bits (e.g: DEFINE_BITFIELD(MYREG, 30, 0) ), the calculation of mask value will go overflow: "error: integer overflow in expression '-2147483648 - 1' of type 'int' results in '2147483647'".
And for bit fields with 32 bits (e.g: DEFINE_BITFIELD(MYREG, 31, 0) ), the error will be: "error: left shift count >= width of type [-Werror=shift-count-overflow]"
To fix these issues, the bit field macros should always use unsigned integers, and use 64bit integer when creating mask value.
Change-Id: Ie3cddf9df60b83de4e21243bfde6b79729fb06ef Signed-off-by: Hung-Te Lin hungte@chromium.org --- M src/include/device/mmio.h 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/40404/5