cse: fix signed integer overflow

literals are signed by default, so shifting them 32 times is an
overflow, found via cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This commit is contained in:
Curtis Malainey 2022-01-11 17:17:48 -08:00 committed by Liam Girdwood
parent 32052add99
commit 23a53ac8b6
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ static uint32_t crc32(uint8_t *input, int size, uint32_t poly, uint32_t init,
if (rev_out) {
t32 = 0;
for (i = 0; i < 32; i++) {
if (crc & (1 << i))
if (crc & (1U << i))
t32 |= (uint32_t)(1 << (31 - i));
}
crc = t32;