diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-06-07 06:22:28 +0300 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2025-06-30 19:31:57 +0300 |
| commit | f2703a104e89077e622e2f34ac686262c5180d71 (patch) | |
| tree | 4886a3c868496d465dac7f53f9b1c91d90823b08 /include/linux | |
| parent | b0e04dde8e78fd0f08210c594ab29cbbcd841b73 (diff) | |
| download | linux-f2703a104e89077e622e2f34ac686262c5180d71.tar.xz | |
lib/crc32: Remove unused combination support
Remove crc32_le_combine() and crc32_le_shift(), since they are no longer
used.
Although combination is an interesting thing that can be done with CRCs,
it turned out that none of the users of it in the kernel were even close
to being worthwhile. All were much better off simply chaining the CRCs
or processing zeroes.
Let's remove the CRC32 combination code for now. It can come back
(potentially optimized with carryless multiplication instructions) if
there is ever a case where it would actually be worthwhile.
Link: https://lore.kernel.org/r/20250607032228.27868-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/crc32.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 8c1883b81b42..36bbc0405aa0 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h @@ -48,31 +48,6 @@ u32 crc32_optimizations(void); static inline u32 crc32_optimizations(void) { return 0; } #endif -/** - * crc32_le_combine - Combine two crc32 check values into one. For two - * sequences of bytes, seq1 and seq2 with lengths len1 - * and len2, crc32_le() check values were calculated - * for each, crc1 and crc2. - * - * @crc1: crc32 of the first block - * @crc2: crc32 of the second block - * @len2: length of the second block - * - * Return: The crc32_le() check value of seq1 and seq2 concatenated, - * requiring only crc1, crc2, and len2. Note: If seq_full denotes - * the concatenated memory area of seq1 with seq2, and crc_full - * the crc32_le() value of seq_full, then crc_full == - * crc32_le_combine(crc1, crc2, len2) when crc_full was seeded - * with the same initializer as crc1, and crc2 seed was 0. See - * also crc32_combine_test(). - */ -u32 crc32_le_shift(u32 crc, size_t len); - -static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2) -{ - return crc32_le_shift(crc1, len2) ^ crc2; -} - #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) /* |
