Commit f9110822 authored by Herbert Xu's avatar Herbert Xu

crypto: api - Disable boot-test-finished if algapi is a module

The boot-test-finished toggle is only necessary if algapi
is built into the kernel.  Do not include this code if it is a module.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b42519db
...@@ -1056,6 +1056,9 @@ EXPORT_SYMBOL_GPL(crypto_type_has_alg); ...@@ -1056,6 +1056,9 @@ EXPORT_SYMBOL_GPL(crypto_type_has_alg);
static void __init crypto_start_tests(void) static void __init crypto_start_tests(void)
{ {
if (!IS_BUILTIN(CONFIG_CRYPTO_ALGAPI))
return;
if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)) if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS))
return; return;
......
...@@ -31,9 +31,9 @@ EXPORT_SYMBOL_GPL(crypto_alg_sem); ...@@ -31,9 +31,9 @@ EXPORT_SYMBOL_GPL(crypto_alg_sem);
BLOCKING_NOTIFIER_HEAD(crypto_chain); BLOCKING_NOTIFIER_HEAD(crypto_chain);
EXPORT_SYMBOL_GPL(crypto_chain); EXPORT_SYMBOL_GPL(crypto_chain);
#ifndef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS #if IS_BUILTIN(CONFIG_CRYPTO_ALGAPI) && \
!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)
DEFINE_STATIC_KEY_FALSE(__crypto_boot_test_finished); DEFINE_STATIC_KEY_FALSE(__crypto_boot_test_finished);
EXPORT_SYMBOL_GPL(__crypto_boot_test_finished);
#endif #endif
static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg); static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg);
......
...@@ -66,7 +66,8 @@ extern struct blocking_notifier_head crypto_chain; ...@@ -66,7 +66,8 @@ extern struct blocking_notifier_head crypto_chain;
int alg_test(const char *driver, const char *alg, u32 type, u32 mask); int alg_test(const char *driver, const char *alg, u32 type, u32 mask);
#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS #if !IS_BUILTIN(CONFIG_CRYPTO_ALGAPI) || \
IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)
static inline bool crypto_boot_test_finished(void) static inline bool crypto_boot_test_finished(void)
{ {
return true; return true;
...@@ -84,7 +85,9 @@ static inline void set_crypto_boot_test_finished(void) ...@@ -84,7 +85,9 @@ static inline void set_crypto_boot_test_finished(void)
{ {
static_branch_enable(&__crypto_boot_test_finished); static_branch_enable(&__crypto_boot_test_finished);
} }
#endif /* !CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */ #endif /* !IS_BUILTIN(CONFIG_CRYPTO_ALGAPI) ||
* IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)
*/
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
void __init crypto_init_proc(void); void __init crypto_init_proc(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment