diff options
| author | Eric Biggers <ebiggers@google.com> | 2025-02-07 18:49:09 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers@google.com> | 2025-02-08 20:06:30 -0800 |
| commit | 8df36829045a133d558421cc3cf2384a6d9e47cc (patch) | |
| tree | 1093d4eef554bb5f28fb7a72101f007c20e20af7 /include/linux/crc32.h | |
| parent | bc2736fe7e0b03866b4cb2da320b1aa705b193c0 (diff) | |
lib/crc32: standardize on crc32c() name for Castagnoli CRC32
For historical reasons, the Castagnoli CRC32 is available under 3 names:
crc32c(), crc32c_le(), and __crc32c_le(). Most callers use crc32c().
The more verbose versions are not really warranted; there is no "_be"
version that the "_le" version needs to be differentiated from, and the
leading underscores are pointless.
Therefore, let's standardize on just crc32c(). Remove the other two
names, and update callers accordingly.
Specifically, the new crc32c() comes from what was previously
__crc32c_le(), so compared to the old crc32c() it now takes a size_t
length rather than unsigned int, and it's now in linux/crc32.h instead
of just linux/crc32c.h (which includes linux/crc32.h).
Later patches will also rename __crc32c_le_combine(), crc32c_le_base(),
and crc32c_le_arch().
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250208024911.14936-5-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include/linux/crc32.h')
| -rw-r--r-- | include/linux/crc32.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 61a7ec29d633..bc39b023eac0 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h @@ -29,8 +29,7 @@ static inline u32 crc32_be(u32 crc, const void *p, size_t len) return crc32_be_base(crc, p, len); } -/* TODO: leading underscores should be dropped once callers have been updated */ -static inline u32 __crc32c_le(u32 crc, const void *p, size_t len) +static inline u32 crc32c(u32 crc, const void *p, size_t len) { if (IS_ENABLED(CONFIG_CRC32_ARCH)) return crc32c_le_arch(crc, p, len); @@ -45,7 +44,7 @@ static inline u32 __crc32c_le(u32 crc, const void *p, size_t len) */ #define CRC32_LE_OPTIMIZATION BIT(0) /* crc32_le() is optimized */ #define CRC32_BE_OPTIMIZATION BIT(1) /* crc32_be() is optimized */ -#define CRC32C_OPTIMIZATION BIT(2) /* __crc32c_le() is optimized */ +#define CRC32C_OPTIMIZATION BIT(2) /* crc32c() is optimized */ #if IS_ENABLED(CONFIG_CRC32_ARCH) u32 crc32_optimizations(void); #else |
