]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lib/crypto: sha256: Mark sha256_choose_blocks as __always_inline
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 19:19:40 +0000 (21:19 +0200)
committerEric Biggers <ebiggers@kernel.org>
Fri, 20 Jun 2025 20:22:03 +0000 (13:22 -0700)
When the compiler chooses to not inline sha256_choose_blocks() in
the purgatory code, it fails to link against the missing CPU
specific version:

x86_64-linux-ld: arch/x86/purgatory/purgatory.ro: in function `sha256_choose_blocks.part.0':
sha256.c:(.text+0x6a6): undefined reference to `irq_fpu_usable'
sha256.c:(.text+0x6c7): undefined reference to `sha256_blocks_arch'
sha256.c:(.text+0x6cc): undefined reference to `sha256_blocks_simd'

Mark this function as __always_inline to prevent this, same as sha256_finup().

Fixes: 5b90a779bc54 ("crypto: lib/sha256 - Add helpers for block-based shash")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250620191952.1867578-1-arnd@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
include/crypto/internal/sha2.h

index b9bccd3ff57fc0f39f0e6a8cd55b0864eaabe4ea..21a27fd5e198f84d24d0955739f6d1c903bd9e52 100644 (file)
@@ -25,7 +25,7 @@ void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS],
 void sha256_blocks_simd(u32 state[SHA256_STATE_WORDS],
                        const u8 *data, size_t nblocks);
 
-static inline void sha256_choose_blocks(
+static __always_inline void sha256_choose_blocks(
        u32 state[SHA256_STATE_WORDS], const u8 *data, size_t nblocks,
        bool force_generic, bool force_simd)
 {