diff options
| -rw-r--r-- | lib/libcrc32c.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c index 802f11f0bf5b..b5c3287d8ea4 100644 --- a/lib/libcrc32c.c +++ b/lib/libcrc32c.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/crc32c.h> | 33 | #include <linux/crc32c.h> |
| 34 | #include <linux/compiler.h> | 34 | #include <linux/compiler.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <asm/byteorder.h> | ||
| 37 | 36 | ||
| 38 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); | 37 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); |
| 39 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); | 38 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); |
| @@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = { | |||
| 161 | */ | 160 | */ |
| 162 | 161 | ||
| 163 | u32 __pure | 162 | u32 __pure |
| 164 | crc32c_le(u32 seed, unsigned char const *data, size_t length) | 163 | crc32c_le(u32 crc, unsigned char const *data, size_t length) |
| 165 | { | 164 | { |
| 166 | u32 crc = __cpu_to_le32(seed); | ||
| 167 | |||
| 168 | while (length--) | 165 | while (length--) |
| 169 | crc = | 166 | crc = |
| 170 | crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); | 167 | crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); |
| 171 | 168 | ||
| 172 | return __le32_to_cpu(crc); | 169 | return crc; |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | #endif /* CRC_LE_BITS == 8 */ | 172 | #endif /* CRC_LE_BITS == 8 */ |
