From: Lasse Collin <lasse.collin@tukaani.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Lasse Collin <lasse.collin@tukaani.org>,
Jia Tan <jiat0218@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 06/11] xz: Cleanup CRC32 edits from 2018
Date: Wed, 20 Mar 2024 20:38:39 +0200 [thread overview]
Message-ID: <20240320183846.19475-7-lasse.collin@tukaani.org> (raw)
In-Reply-To: <20240320183846.19475-1-lasse.collin@tukaani.org>
The commit faa16bc404d72a5a ("lib: Use existing define with polynomial")
in 2018 added a dependency on <linux/crc32poly.h> to avoid duplicating
the same constant in multiple files. Two months later it was found to be
a bad idea and the commit 242cdad873a75652 ("lib/xz: Put CRC32_POLY_LE
in xz_private.h") added the definition of CRC32_POLY_LE macro 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.
Reviewed-by: Jia Tan <jiat0218@gmail.com>
Signed-off-by: Lasse Collin <lasse.collin@tukaani.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 30b8a27110b1..effdf34ec48d 100644
--- a/lib/xz/xz_crc32.c
+++ b/lib/xz/xz_crc32.c
@@ -28,7 +28,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 2412a5d54801..811add814ae4 100644
--- a/lib/xz/xz_private.h
+++ b/lib/xz/xz_private.h
@@ -104,10 +104,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().
--
2.44.0
next prev parent reply other threads:[~2024-03-20 18:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 18:38 [PATCH 00/11] xz: Updates to license, filters, and compression options Lasse Collin
2024-03-20 18:38 ` [PATCH 01/11] MAINTAINERS: Add XZ Embedded maintainers Lasse Collin
2024-03-20 18:38 ` [PATCH 02/11] LICENSES: Add 0BSD license text Lasse Collin
2024-03-20 18:38 ` [PATCH 03/11] xz: Switch from public domain to BSD Zero Clause License (0BSD) Lasse Collin
2024-03-20 18:38 ` [PATCH 04/11] xz: Documentation/staging/xz.rst: Revise thoroughly Lasse Collin
2024-03-20 18:38 ` [PATCH 05/11] xz: Fix comments and coding style Lasse Collin
2024-03-20 18:38 ` Lasse Collin [this message]
2024-03-20 18:38 ` [PATCH 07/11] xz: Optimize for-loop conditions in the BCJ decoders Lasse Collin
2024-03-20 18:38 ` [PATCH 08/11] xz: Add ARM64 BCJ filter Lasse Collin
2024-03-20 18:38 ` [PATCH 09/11] xz: Add RISC-V " Lasse Collin
2024-03-20 18:38 ` [PATCH 10/11] xz: Use 128 MiB dictionary and force single-threaded mode Lasse Collin
2024-03-20 18:38 ` [PATCH 11/11] xz: Adjust arch-specific options for better kernel compression Lasse Collin
2024-03-31 0:42 ` angel.lkml
2024-04-03 19:59 ` Lasse Collin
2024-04-04 14:01 ` Lasse Collin
2024-03-29 19:24 ` [PATCH 00/11] xz: Updates to license, filters, and compression options Jonathan Bennett
2024-03-29 19:32 ` Kees Cook
2024-03-29 20:51 ` [tech-board] " Jonathan Corbet
2024-03-30 0:37 ` Kees Cook
2024-03-30 2:56 ` [tech-board] " Andrew Morton
2024-03-30 12:48 ` Lasse Collin
2024-03-30 13:54 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240320183846.19475-7-lasse.collin@tukaani.org \
--to=lasse.collin@tukaani.org \
--cc=akpm@linux-foundation.org \
--cc=jiat0218@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).