From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760726AbdACTFl (ORCPT ); Tue, 3 Jan 2017 14:05:41 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:58360 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755898AbdACTFC (ORCPT ); Tue, 3 Jan 2017 14:05:02 -0500 From: Geert Uytterhoeven To: Andrew Morton Cc: Matt Domsch , Luca Barbieri , George Spelvin , linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/3] lib: Add module support to atomic64 tests Date: Tue, 3 Jan 2017 20:04:36 +0100 Message-Id: <1483470276-10517-3-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483470276-10517-1-git-send-email-geert@linux-m68k.org> References: <1483470276-10517-1-git-send-email-geert@linux-m68k.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow to compile the atomic64 test code either to a loadable module, or builtin into the kernel. Signed-off-by: Geert Uytterhoeven --- lib/Kconfig.debug | 5 +++-- lib/atomic64_test.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b06848a104e6940e..42e210544b27fca7 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1765,9 +1765,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 46042901130f107b..fd70c0e0e6731499 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"); -- 1.9.1