Skip to contentSkip to conversation

crypto: aegis128 - fix link error without SIMD

PATCH In review Arnd Bergmann 2 participants 2 messages Dec 3, 2020 – Dec 4, 2020 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: aegis128 - fix link error without SIMD

From: Arnd Bergmann <[email protected]>

When the SIMD portion of the driver is disabled, the compiler cannot figure out in advance if it will be called:

ERROR: modpost: "crypto_aegis128_update_simd" [crypto/aegis128.ko] undefined!

Add a conditional to let the compiler use dead code elimination as before.

Fixes ac50aec41a9f ("crypto: aegis128 - expose SIMD code path as separate driver")
---
 crypto/aegis128-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/aegis128-core.c +2 -2
index 2b05f79475d3..89dc1c559689 100644
@@ -89,7 +89,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state,
 				     const union aegis_block *msg,
 				     bool do_simd)
 {
-	if (do_simd) {
+	if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
 		crypto_aegis128_update_simd(state, msg);
 		return;
 	}
@@ -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,
 				     bool do_simd)
 {
-	if (do_simd) {
+	if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
 		crypto_aegis128_update_simd(state, msg);
 		return;
 	}
Signature · 1 line
2.27.0
#1 lore raw
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When the SIMD portion of the driver is disabled, the compiler cannot figure out in advance if it will be called:

Quoted 7 lines

ERROR: modpost: "crypto_aegis128_update_simd" [crypto/aegis128.ko] undefined!

Add a conditional to let the compiler use dead code elimination as before.

Fixes ac50aec41a9f ("crypto: aegis128 - expose SIMD code path as separate driver")

I already sent the exact same fix a couple of days ago, and Herbert just merged it today.

Quoted 29 lines
---
 crypto/aegis128-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/aegis128-core.c +2 -3
index 2b05f79475d3..89dc1c559689 100644
@@ -89,7 +89,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state,
                                     const union aegis_block *msg,
                                     bool do_simd)
 {
-       if (do_simd) {
+       if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
                crypto_aegis128_update_simd(state, msg);
                return;
        }
@@ -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,
                                     bool do_simd)
 {
-       if (do_simd) {
+       if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) {
                crypto_aegis128_update_simd(state, msg);
                return;
        }
--

2.27.0