diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 66fb4389f05c..213decb76922 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1790,9 +1790,10 @@ config PERCPU_TEST If unsure, say N. config ATOMIC64_SELFTEST - bool "Perform an atomic64_t self-test at boot" + tristate "Perform an atomic64_t self-test" help - Enable this option to test the atomic64_t functions at boot. + Enable this option to test the atomic64_t functions at boot or + at module load time. If unsure, say N. diff --git a/lib/atomic64_test.c b/lib/atomic64_test.c index 46042901130f..fd70c0e0e673 100644 --- a/lib/atomic64_test.c +++ b/lib/atomic64_test.c @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef CONFIG_X86 #include /* for boot_cpu_has below */ @@ -241,7 +242,7 @@ static __init void test_atomic64(void) BUG_ON(v.counter != r); } -static __init int test_atomics(void) +static __init int test_atomics_init(void) { test_atomic(); test_atomic64(); @@ -264,4 +265,9 @@ static __init int test_atomics(void) return 0; } -core_initcall(test_atomics); +static __exit void test_atomics_exit(void) {} + +module_init(test_atomics_init); +module_exit(test_atomics_exit); + +MODULE_LICENSE("GPL");