]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: crc32 - don't unnecessarily register arch algorithms
authorEric Biggers <ebiggers@google.com>
Mon, 2 Dec 2024 01:08:29 +0000 (17:08 -0800)
committerEric Biggers <ebiggers@google.com>
Mon, 2 Dec 2024 01:23:01 +0000 (17:23 -0800)
commit780acb2543eaf163169f8c6d6fe52e7f94a7b0d4
tree1d6cc1d01422732354001e5c3c0737176421e260
parentb5ae12e0ee099e4c458f7814f0317f4e2cbf105e
crypto: crc32 - don't unnecessarily register arch algorithms

Instead of registering the crc32-$arch and crc32c-$arch algorithms if
the arch-specific code was built, only register them when that code was
built *and* is not falling back to the base implementation at runtime.

This avoids confusing users like btrfs which checks the shash driver
name to determine whether it is crc32c-generic.

(It would also make sense to change btrfs to test the crc32_optimization
flags itself, so that it doesn't have to use the weird hack of parsing
the driver name.  This change still makes sense either way though.)

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20241202010844.144356-5-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
crypto/crc32_generic.c
crypto/crc32c_generic.c