Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef19454bd437b2ba14c9cda1de85debd9f383484
Commit:     ef19454bd437b2ba14c9cda1de85debd9f383484
Parent:     dbeeb816e805091e7cfc03baf36dc40b4adb2bbd
Author:     Benny Halevy <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 8 21:34:09 2007 +0800
Committer:  Herbert Xu <[EMAIL PROTECTED]>
CommitDate: Thu Nov 8 21:34:09 2007 +0800

    [LIB] crc32c: Keep intermediate crc state in cpu order
    
    crypto/crc32.c:chksum_final() is computing the digest as
    *(__le32 *)out = ~cpu_to_le32(mctx->crc);
    so the low-level crc32c_le routines should just keep
    the crc in cpu order, otherwise it is getting swabbed
    one too many times on big-endian machines.
    
    Signed-off-by: Benny Halevy <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
---
 lib/libcrc32c.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c
index 802f11f..b5c3287 100644
--- a/lib/libcrc32c.c
+++ b/lib/libcrc32c.c
@@ -33,7 +33,6 @@
 #include <linux/crc32c.h>
 #include <linux/compiler.h>
 #include <linux/module.h>
-#include <asm/byteorder.h>
 
 MODULE_AUTHOR("Clay Haapala <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations");
@@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = {
  */
 
 u32 __pure
-crc32c_le(u32 seed, unsigned char const *data, size_t length)
+crc32c_le(u32 crc, unsigned char const *data, size_t length)
 {
-       u32 crc = __cpu_to_le32(seed);
-       
        while (length--)
                crc =
                    crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
 
-       return __le32_to_cpu(crc);
+       return crc;
 }
 
 #endif /* CRC_LE_BITS == 8 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to