diff options
author | Eric Biggers <ebiggers@google.com> | 2022-11-13 16:12:34 -0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-11-25 17:39:18 +0800 |
commit | 9cadd73adef1e1d53ea100f28e3e258698b92418 (patch) | |
tree | 842c273fc7fbe8dff1d15e6cbaf7dc8f3a07b1dd /crypto/algboss.c | |
parent | a7008584ab19d2df05caa95634cd72bc41f4cad3 (diff) | |
download | linux-9cadd73adef1e1d53ea100f28e3e258698b92418.tar.gz linux-9cadd73adef1e1d53ea100f28e3e258698b92418.tar.bz2 linux-9cadd73adef1e1d53ea100f28e3e258698b92418.zip |
crypto: algboss - optimize registration of internal algorithms
Since algboss always skips testing of algorithms with the
CRYPTO_ALG_INTERNAL flag, there is no need to go through the dance of
creating the test kthread, which creates a lot of overhead. Instead, we
can just directly finish the algorithm registration, like is now done
when self-tests are disabled entirely.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algboss.c')
-rw-r--r-- | crypto/algboss.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/crypto/algboss.c b/crypto/algboss.c index eb5fe84efb83..13d37320a66e 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -181,12 +181,8 @@ static int cryptomgr_test(void *data) goto skiptest; #endif - if (type & CRYPTO_ALG_TESTED) - goto skiptest; - err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED); -skiptest: crypto_alg_tested(param->driver, err); kfree(param); @@ -197,7 +193,6 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) { struct task_struct *thread; struct crypto_test_param *param; - u32 type; if (!try_module_get(THIS_MODULE)) goto err; @@ -208,13 +203,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) memcpy(param->driver, alg->cra_driver_name, sizeof(param->driver)); memcpy(param->alg, alg->cra_name, sizeof(param->alg)); - type = alg->cra_flags; - - /* Do not test internal algorithms. */ - if (type & CRYPTO_ALG_INTERNAL) - type |= CRYPTO_ALG_TESTED; - - param->type = type; + param->type = alg->cra_flags; thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); if (IS_ERR(thread)) |