Commit 0464e0ef authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu

crypto: aegis128 - avoid spurious references crypto_aegis128_update_simd

Geert reports that builds where CONFIG_CRYPTO_AEGIS128_SIMD is not set
may still emit references to crypto_aegis128_update_simd(), which
cannot be satisfied and therefore break the build. These references
only exist in functions that can be optimized away, but apparently,
the compiler is not always able to prove this.

So add some explicit checks for CONFIG_CRYPTO_AEGIS128_SIMD to help the
compiler figure this out.
Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1069e976
...@@ -89,7 +89,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state, ...@@ -89,7 +89,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state,
const union aegis_block *msg, const union aegis_block *msg,
bool do_simd) bool do_simd)
{ {
if (do_simd) { if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
crypto_aegis128_update_simd(state, msg); crypto_aegis128_update_simd(state, msg);
return; return;
} }
...@@ -101,7 +101,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state, ...@@ -101,7 +101,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state,
static void crypto_aegis128_update_u(struct aegis_state *state, const void *msg, static void crypto_aegis128_update_u(struct aegis_state *state, const void *msg,
bool do_simd) bool do_simd)
{ {
if (do_simd) { if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
crypto_aegis128_update_simd(state, msg); crypto_aegis128_update_simd(state, msg);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment