Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  [LIB] crc32c: Keep intermediate crc state in cpu order
  • Loading branch information
Linus Torvalds committed Nov 9, 2007
2 parents 4c31c30 + ef19454 commit cb834e7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/libcrc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/crc32c.h>
#include <linux/compiler.h>
#include <linux/module.h>
#include <asm/byteorder.h>

MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations");
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit cb834e7

Please sign in to comment.