summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2022-11-13 16:12:38 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2022-11-25 17:39:18 +0800
commit0861aa38a4972d848e8f7332b1f556b98ccdfddc (patch)
treedd088cfcc95db35bcfe29b0585c9a53c312c6711
parent793d70aedbd1b7006aa57283555b0881bb8f8f59 (diff)
downloadlinux-crypto-0861aa38a4972d848e8f7332b1f556b98ccdfddc.tar.gz
linux-crypto-0861aa38a4972d848e8f7332b1f556b98ccdfddc.zip
crypto: algboss - compile out test-related code when tests disabled
When CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is set, the code in algboss.c that handles CRYPTO_MSG_ALG_REGISTER is unnecessary, so make it be compiled out. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/algboss.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/algboss.c b/crypto/algboss.c
index 13d37320..0de1e669 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -175,11 +175,7 @@ static int cryptomgr_test(void *data)
{
struct crypto_test_param *param = data;
u32 type = param->type;
- int err = 0;
-
-#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
- goto skiptest;
-#endif
+ int err;
err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);
@@ -194,6 +190,9 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)
struct task_struct *thread;
struct crypto_test_param *param;
+ if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS))
+ return NOTIFY_DONE;
+
if (!try_module_get(THIS_MODULE))
goto err;