* [PATCH] crypto: aegis128 - fix link error without SIMD
@ 2020-12-03 22:25 Arnd Bergmann
2020-12-04 8:22 ` Ard Biesheuvel
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-12-03 22:25 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Ondrej Mosnacek, Ard Biesheuvel
Cc: Arnd Bergmann, Eric Biggers, linux-crypto, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
crypto/aegis128-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c
index 2b05f79475d3..89dc1c559689 100644
--- a/crypto/aegis128-core.c
+++ b/crypto/aegis128-core.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: aegis128 - fix link error without SIMD
2020-12-03 22:25 [PATCH] crypto: aegis128 - fix link error without SIMD Arnd Bergmann
@ 2020-12-04 8:22 ` Ard Biesheuvel
0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2020-12-04 8:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Herbert Xu, David S. Miller, Ondrej Mosnacek, Arnd Bergmann,
Eric Biggers, Linux Crypto Mailing List,
Linux Kernel Mailing List
On Thu, 3 Dec 2020 at 23:26, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
I already sent the exact same fix a couple of days ago, and Herbert
just merged it today.
> ---
> crypto/aegis128-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c
> index 2b05f79475d3..89dc1c559689 100644
> --- a/crypto/aegis128-core.c
> +++ b/crypto/aegis128-core.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-04 8:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 22:25 [PATCH] crypto: aegis128 - fix link error without SIMD Arnd Bergmann
2020-12-04 8:22 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).