6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lasse Collin lasse.collin@tukaani.org
[ Upstream commit 2ee96abef214550d9e92f5143ee3ac1fd1323e67 ]
In 2018, a dependency on <linux/crc32poly.h> was added to avoid duplicating the same constant in multiple files. Two months later it was found to be a bad idea and the definition of CRC32_POLY_LE macro was moved into xz_private.h to avoid including <linux/crc32poly.h>.
xz_private.h is a wrong place for it too. Revert back to the upstream version which has the poly in xz_crc32_init() in xz_crc32.c.
Link: https://lkml.kernel.org/r/20240721133633.47721-10-lasse.collin@tukaani.org Fixes: faa16bc404d7 ("lib: Use existing define with polynomial") Fixes: 242cdad873a7 ("lib/xz: Put CRC32_POLY_LE in xz_private.h") Signed-off-by: Lasse Collin lasse.collin@tukaani.org Reviewed-by: Sam James sam@gentoo.org Tested-by: Michael Ellerman mpe@ellerman.id.au (powerpc) Cc: Krzysztof Kozlowski krzk@kernel.org Cc: Herbert Xu herbert@gondor.apana.org.au Cc: Joel Stanley joel@jms.id.au Cc: Albert Ou aou@eecs.berkeley.edu Cc: Catalin Marinas catalin.marinas@arm.com Cc: Emil Renner Berthing emil.renner.berthing@canonical.com Cc: Greg Kroah-Hartman gregkh@linuxfoundation.org Cc: Jonathan Corbet corbet@lwn.net Cc: Jubin Zhong zhongjubin@huawei.com Cc: Jules Maselbas jmaselbas@zdiv.net Cc: Palmer Dabbelt palmer@dabbelt.com Cc: Paul Walmsley paul.walmsley@sifive.com Cc: Randy Dunlap rdunlap@infradead.org Cc: Rui Li me@lirui.org Cc: Simon Glass sjg@chromium.org Cc: Thomas Gleixner tglx@linutronix.de Cc: Will Deacon will@kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Sasha Levin sashal@kernel.org --- lib/xz/xz_crc32.c | 2 +- lib/xz/xz_private.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/xz/xz_crc32.c b/lib/xz/xz_crc32.c index 88a2c35e1b597..5627b00fca296 100644 --- a/lib/xz/xz_crc32.c +++ b/lib/xz/xz_crc32.c @@ -29,7 +29,7 @@ STATIC_RW_DATA uint32_t xz_crc32_table[256];
XZ_EXTERN void xz_crc32_init(void) { - const uint32_t poly = CRC32_POLY_LE; + const uint32_t poly = 0xEDB88320;
uint32_t i; uint32_t j; diff --git a/lib/xz/xz_private.h b/lib/xz/xz_private.h index bf1e94ec7873c..d9fd49b45fd75 100644 --- a/lib/xz/xz_private.h +++ b/lib/xz/xz_private.h @@ -105,10 +105,6 @@ # endif #endif
-#ifndef CRC32_POLY_LE -#define CRC32_POLY_LE 0xedb88320 -#endif - /* * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used * before calling xz_dec_lzma2_run().