Filip Brozovic has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86099?usp=email )
Change subject: lib/crc_byte: Parenthesize buffer address in CRC macro ......................................................................
lib/crc_byte: Parenthesize buffer address in CRC macro
This changes fixes CRC calculations in cases where an expression calculating the address using pointer arithmetic is passed into the macro.
Change-Id: I55bbd2f208a94068ea3b3b3ae97b1683434c3007 Signed-off-by: Filip Brozovic fbrozovic@gmail.com --- M src/include/crc_byte.h 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/86099/1
diff --git a/src/include/crc_byte.h b/src/include/crc_byte.h index 85b7221..972b89a 100644 --- a/src/include/crc_byte.h +++ b/src/include/crc_byte.h @@ -35,7 +35,7 @@ uint32_t crc32_byte(uint32_t prev_crc, uint8_t data);
#define CRC(buf, size, crc_func) ({ \ - const uint8_t *_crc_local_buf = (const uint8_t *)buf; \ + const uint8_t *_crc_local_buf = (const uint8_t *)(buf); \ size_t _crc_local_size = size; \ __typeof__(crc_func(0, 0)) _crc_local_result = 0; \ while (_crc_local_size--) { \