Skip to content

Commit 64f7548

Browse files
arndbEric Biggers
authored andcommitted
lib/crypto: sha256: Mark sha256_choose_blocks as __always_inline
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: 5b90a77 ("crypto: lib/sha256 - Add helpers for block-based shash") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 9d4204a commit 64f7548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/crypto/internal/sha2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS],
2525
void sha256_blocks_simd(u32 state[SHA256_STATE_WORDS],
2626
const u8 *data, size_t nblocks);
2727

28-
static inline void sha256_choose_blocks(
28+
static __always_inline void sha256_choose_blocks(
2929
u32 state[SHA256_STATE_WORDS], const u8 *data, size_t nblocks,
3030
bool force_generic, bool force_simd)
3131
{

0 commit comments

Comments
 (0)