diff options
| author | Eric Biggers <ebiggers@google.com> | 2025-01-29 19:51:20 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers@google.com> | 2025-02-08 20:06:19 -0800 |
| commit | feb541bfacbe23bf19a96b96db03e6c7505e1b03 (patch) | |
| tree | 8cfa2019a08edcc24ce8133e226ff93fefc91cab /include/linux/crc64.h | |
| parent | 2014c95afecee3e76ca4a56956a936e23283f05b (diff) | |
| download | lwn-feb541bfacbe23bf19a96b96db03e6c7505e1b03.tar.gz lwn-feb541bfacbe23bf19a96b96db03e6c7505e1b03.zip | |
lib/crc64-rocksoft: stop wrapping the crypto API
Following what was done for the CRC32 and CRC-T10DIF library functions,
get rid of the pointless use of the crypto API and make
crc64_rocksoft_update() call into the library directly. This is faster
and simpler.
Remove crc64_rocksoft() (the version of the function that did not take a
'crc' argument) since it is unused.
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Acked-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20250130035130.180676-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include/linux/crc64.h')
| -rw-r--r-- | include/linux/crc64.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/crc64.h b/include/linux/crc64.h index e044c60d1e61..0a595b272166 100644 --- a/include/linux/crc64.h +++ b/include/linux/crc64.h @@ -12,7 +12,16 @@ u64 __pure crc64_be(u64 crc, const void *p, size_t len); u64 __pure crc64_rocksoft_generic(u64 crc, const void *p, size_t len); -u64 crc64_rocksoft(const unsigned char *buffer, size_t len); -u64 crc64_rocksoft_update(u64 crc, const unsigned char *buffer, size_t len); +/** + * crc64_rocksoft_update - Calculate bitwise Rocksoft CRC64 + * @crc: seed value for computation. 0 for a new CRC calculation, or the + * previous crc64 value if computing incrementally. + * @p: pointer to buffer over which CRC64 is run + * @len: length of buffer @p + */ +static inline u64 crc64_rocksoft_update(u64 crc, const u8 *p, size_t len) +{ + return crc64_rocksoft_generic(crc, p, len); +} #endif /* _LINUX_CRC64_H */ |
