diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2017-02-08 10:27:53 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-02-08 10:27:53 +1100 |
commit | e14ef268df6ea3e1d33285557d924a4b106d9d13 (patch) | |
tree | c3d7332774926929af9c9a6a7eb536053544c0a7 /lib/atomic64_test.c | |
parent | e519777a8b4bdd2c9cdd0e00f284cbe48b90f588 (diff) |
lib: add module support to atomic64 tests
Allow to compile the atomic64 test code either to a loadable module, or
builtin into the kernel.
Link: http://lkml.kernel.org/r/1483470276-10517-3-git-send-email-geert@linux-m68k.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/atomic64_test.c')
-rw-r--r-- | lib/atomic64_test.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <linux/bug.h> #include <linux/kernel.h> #include <linux/atomic.h> +#include <linux/module.h> #ifdef CONFIG_X86 #include <asm/cpufeature.h> /* 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"); |