lib/crc_byte: Parenthesize buffer address in CRC macro
This change 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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/86099 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
9dee482a8d
commit
ad3638e338
1 changed files with 1 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ uint16_t crc16_byte(uint16_t prev_crc, uint8_t data);
|
|||
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--) { \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue