aboutsummaryrefslogtreecommitdiffstats
path: root/crc32c.c
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2008-02-15 11:20:02 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-02-15 11:20:02 -0500
commit355351fc1dde9bd2c525e40c6228b9db07d95cae (patch)
tree959788f51666d638ad3d2f2e525f30a73ac745ec /crc32c.c
parent8871a0eaa98d951727e97c615d831af9a60432ae (diff)
downloadbtrfs-progs-355351fc1dde9bd2c525e40c6228b9db07d95cae.tar.gz
btrfs-progs-355351fc1dde9bd2c525e40c6228b9db07d95cae.tar.xz
btrfs-progs-355351fc1dde9bd2c525e40c6228b9db07d95cae.zip
CRC32C big endian bugs...v0.13
The CRC32C implementation in the btrfs progs is different from the one in the kernel, so obviously nothing can possibly work on big-endian.
Diffstat (limited to 'crc32c.c')
-rw-r--r--crc32c.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crc32c.c b/crc32c.c
index f07ba13..4dc5f9c 100644
--- a/crc32c.c
+++ b/crc32c.c
@@ -91,13 +91,11 @@ static const u32 crc32c_table[256] = {
* crc using table.
*/
-u32 crc32c_le(u32 seed, unsigned char const *data, size_t length)
+u32 crc32c_le(u32 crc, unsigned char const *data, size_t length)
{
- u32 crc = (__force __u32)(cpu_to_le32(seed));
-
while (length--)
crc =
crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
- return le32_to_cpu((__force __le32)crc);
+ return crc;
}