Skip to content

Commit

Permalink
crypto: algboss - compile out test-related code when tests disabled
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Nov 25, 2022
1 parent 790c4c9 commit 441cb1b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crypto/algboss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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

Expand Down

0 comments on commit 441cb1b

Please sign in to comment.