Commit 06575601 authored by Marek Vasut's avatar Marek Vasut

mxssb: Clean up the data types in crc32()

Make the data type used in crc32() call more precise to avoid clang
warnings with -Weverything.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent b352fc80
...@@ -174,17 +174,17 @@ static int sb_aes_reinit(struct sb_image_ctx *ictx, int enc) ...@@ -174,17 +174,17 @@ static int sb_aes_reinit(struct sb_image_ctx *ictx, int enc)
/* /*
* CRC32 * CRC32
*/ */
static uint32_t crc32(uint8_t *data, int len) static uint32_t crc32(uint8_t *data, uint32_t len)
{ {
const uint32_t poly = 0x04c11db7; const uint32_t poly = 0x04c11db7;
uint32_t crc32 = 0xffffffff; uint32_t crc32 = 0xffffffff;
int byte, bit; unsigned int byte, bit;
for (byte = 0; byte < len; byte++) { for (byte = 0; byte < len; byte++) {
crc32 ^= data[byte] << 24; crc32 ^= data[byte] << 24;
for (bit = 8; bit > 0; bit--) { for (bit = 8; bit > 0; bit--) {
if (crc32 & (1 << 31)) if (crc32 & (1UL << 31))
crc32 = (crc32 << 1) ^ poly; crc32 = (crc32 << 1) ^ poly;
else else
crc32 = (crc32 << 1); crc32 = (crc32 << 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment