Message ID | 20221110081346.336046-7-ebiggers@kernel.org |
---|---|
State | New |
Headers | show |
Series | crypto: reduce overhead when self-tests disabled | expand |
Eric Biggers <ebiggers@kernel.org> wrote: > @@ -171,15 +171,17 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) > return NOTIFY_OK; > } > > +#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS > +static int cryptomgr_schedule_test(struct crypto_alg *alg) > +{ > + return NOTIFY_DONE; > +} > +#else Could you please do this inline with an if statement rather than as #ifdefs? That is, static int cryptomgr_schedule_test(struct crypto_alg *alg) { struct task_struct *thread; struct crypto_test_param *param; u32 type; if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) return NOTIFY_DONE; Thanks,
diff --git a/crypto/algboss.c b/crypto/algboss.c index 13d37320a66eb..f3c6c9fe133d5 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -171,15 +171,17 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) return NOTIFY_OK; } +#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS +static int cryptomgr_schedule_test(struct crypto_alg *alg) +{ + return NOTIFY_DONE; +} +#else 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); @@ -218,6 +220,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) err: return NOTIFY_OK; } +#endif /* !CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */ static int cryptomgr_notify(struct notifier_block *this, unsigned long msg, void *data)