crypto: algboss - compile out test-related code when tests disabled

JIRA: https://issues.redhat.com/browse/RHEL-2361

commit 441cb1b730006bd2d636f72dc7f6e11a8a0ecce5
Author: Eric Biggers <ebiggers@google.com>
Date:   Sun Nov 13 16:12:38 2022 -0800

    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>

Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
Brian Masney 2023-09-06 07:56:22 -04:00
parent 4d829327de
commit 5d2a320ad1
1 changed files with 4 additions and 5 deletions

View File

@ -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;