diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-06-24 22:24:15 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-05 13:00:01 +0200 |
commit | 1b5de4c0fe01757587b99bad1b9bdefaad8f5cf4 (patch) | |
tree | 0624de98b5f8af1c0ca706b3c9bb3cdc81ecec43 /lib | |
parent | a398a920b6847775c255e2a783c9562bd7227e43 (diff) | |
download | barebox-1b5de4c0fe01757587b99bad1b9bdefaad8f5cf4.tar.gz barebox-1b5de4c0fe01757587b99bad1b9bdefaad8f5cf4.tar.xz |
crc32: activate crc32_no_comp (needed for jffs2 and UBI)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crc32.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/crc32.c b/lib/crc32.c index be35366fb6..34817824f1 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -132,8 +132,10 @@ static const ulong crc_table[256] = { #define DO8(buf) DO4(buf); DO4(buf); /* ========================================================================= */ -ulong crc32(ulong crc, const unsigned char *buf, uint len) +uint32_t crc32(uint32_t crc, const void *_buf, unsigned int len) { + const unsigned char *buf = _buf; + #ifdef CONFIG_DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); @@ -153,13 +155,13 @@ ulong crc32(ulong crc, const unsigned char *buf, uint len) EXPORT_SYMBOL(crc32); #endif -#if 0 - /* No ones complement version. JFFS2 (and other things ?) * don't use ones compliment in their CRC calculations. */ -uLong crc32_no_comp(uLong crc, const Bytef *buf, uint len) +uint32_t crc32_no_comp(uint32_t crc, const void *_buf, unsigned int len) { + const unsigned char *buf = _buf; + #ifdef CONFIG_DYNAMIC_CRC_TABLE if (crc_table_empty) make_crc_table(); @@ -176,4 +178,3 @@ uLong crc32_no_comp(uLong crc, const Bytef *buf, uint len) return crc; } -#endif |