From 7ac7375df3cd40717b27e5c4fb92052ee6730c7b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 10 Dec 2009 14:24:22 +0100 Subject: crc32: Remove useless BIT_MASK macro and replace only user by constant --- crc32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crc32.c b/crc32.c index 14920a2..e07bbed 100644 --- a/crc32.c +++ b/crc32.c @@ -3,8 +3,6 @@ #include "crc32.h" -#define BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL << (n)) - 1)) - /* Table computed with Mark Adler's makecrc.c utility. */ static const uint32_t crc32_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, @@ -67,7 +65,7 @@ uint32_t crc32(uint32_t crc, uint8_t *buf, size_t len) crc = ~crc; for (end = buf + len; buf < end; buf++) - crc = crc32_table[(crc ^ *buf) & BIT_MASK(8)] ^ (crc >> 8); + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); return ~crc; } -- cgit v1.2.3-54-g00ecf bd9df8d1353c76a84cb5439fb217eb32df'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
ModeNameSize