Skip to content

Commit faa16bc

Browse files
krzkherbertx
authored andcommitted
lib: Use existing define with polynomial
Do not define again the polynomial but use header with existing define. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 9ecdb98 commit faa16bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/decompress_bunzip2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#endif /* STATIC */
5252

5353
#include <linux/decompress/mm.h>
54+
#include <linux/crc32poly.h>
5455

5556
#ifndef INT_MAX
5657
#define INT_MAX 0x7fffffff
@@ -654,7 +655,7 @@ static int INIT start_bunzip(struct bunzip_data **bdp, void *inbuf, long len,
654655
for (i = 0; i < 256; i++) {
655656
c = i << 24;
656657
for (j = 8; j; j--)
657-
c = c&0x80000000 ? (c << 1)^0x04c11db7 : (c << 1);
658+
c = c&0x80000000 ? (c << 1)^(CRC32_POLY_BE) : (c << 1);
658659
bd->crc32Table[i] = c;
659660
}
660661

lib/xz/xz_crc32.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* but they are bigger and use more memory for the lookup table.
1616
*/
1717

18+
#include <linux/crc32poly.h>
1819
#include "xz_private.h"
1920

2021
/*
@@ -29,7 +30,7 @@ STATIC_RW_DATA uint32_t xz_crc32_table[256];
2930

3031
XZ_EXTERN void xz_crc32_init(void)
3132
{
32-
const uint32_t poly = 0xEDB88320;
33+
const uint32_t poly = CRC32_POLY_LE;
3334

3435
uint32_t i;
3536
uint32_t j;

0 commit comments

Comments
 (0)