]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/crc32: expose whether the lib is really optimized at runtime
authorEric Biggers <ebiggers@google.com>
Mon, 2 Dec 2024 01:08:28 +0000 (17:08 -0800)
committerEric Biggers <ebiggers@google.com>
Mon, 2 Dec 2024 01:23:01 +0000 (17:23 -0800)
commitb5ae12e0ee099e4c458f7814f0317f4e2cbf105e
tree2971f631ae4a609aafc5c4e5c932bcd8a6117ab9
parentd36cebe03c3ae4ea1fde20cfc797fab8729c3ab5
lib/crc32: expose whether the lib is really optimized at runtime

Make the CRC32 library export a function crc32_optimizations() which
returns flags that indicate which CRC32 functions are actually executing
optimized code at runtime.

This will be used to determine whether the crc32[c]-$arch shash
algorithms should be registered in the crypto API.  btrfs could also
start using these flags instead of the hack that it currently uses where
it parses the crypto_shash_driver_name.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20241202010844.144356-4-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
arch/arm64/lib/crc32-glue.c
arch/riscv/lib/crc32-riscv.c
include/linux/crc32.h