summaryrefslogtreecommitdiff
path: root/lib/crypto/x86/sha512.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@kernel.org>2025-07-31 15:36:51 -0700
committerEric Biggers <ebiggers@kernel.org>2025-08-26 12:52:27 -0400
commitbce5816672ec27085489f096ec27739a4a233b7b (patch)
tree83282d1b42b6392724378d9e78132f545b650b41 /lib/crypto/x86/sha512.h
parent640d31ea83c6f67133d47df9a0973f3281c91cf4 (diff)
lib/crypto: sha512: Use underlying functions instead of crypto_simd_usable()
Since sha512_kunit tests the fallback code paths without using crypto_simd_disabled_for_test, make the SHA-512 code just use the underlying may_use_simd() and irq_fpu_usable() functions directly instead of crypto_simd_usable(). This eliminates an unnecessary layer. Link: https://lore.kernel.org/r/20250731223651.136939-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib/crypto/x86/sha512.h')
-rw-r--r--lib/crypto/x86/sha512.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/crypto/x86/sha512.h b/lib/crypto/x86/sha512.h
index c13503d9d57d..be2c8fc12246 100644
--- a/lib/crypto/x86/sha512.h
+++ b/lib/crypto/x86/sha512.h
@@ -4,9 +4,7 @@
*
* Copyright 2025 Google LLC
*/
-
#include <asm/fpu/api.h>
-#include <crypto/internal/simd.h>
#include <linux/static_call.h>
DEFINE_STATIC_CALL(sha512_blocks_x86, sha512_blocks_generic);
@@ -17,7 +15,7 @@ DEFINE_STATIC_CALL(sha512_blocks_x86, sha512_blocks_generic);
static void c_fn(struct sha512_block_state *state, const u8 *data, \
size_t nblocks) \
{ \
- if (likely(crypto_simd_usable())) { \
+ if (likely(irq_fpu_usable())) { \
kernel_fpu_begin(); \
asm_fn(state, data, nblocks); \
kernel_fpu_end(); \