lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers
authorTimur Tabi <timur@kernel.org>
Sun, 14 Feb 2021 16:13:46 +0000 (10:13 -0600)
committerPetr Mladek <pmladek@suse.com>
Mon, 15 Feb 2021 10:01:42 +0000 (11:01 +0100)
Instead of defining the total/failed test counters manually,
test drivers that are clients of kselftest should use the
macro created for this purpose.

Signed-off-by: Timur Tabi <timur@kernel.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Marco Elver <elver@google.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210214161348.369023-2-timur@kernel.org
lib/test_bitmap.c
lib/test_printf.c

index 4425a1dd4ef1c7d859730cfb30810853752852e5..0ea0e8258f14a5e5e5a1592154fa7bdd770eb4ce 100644 (file)
@@ -16,8 +16,7 @@
 
 #include "../tools/testing/selftests/kselftest_module.h"
 
-static unsigned total_tests __initdata;
-static unsigned failed_tests __initdata;
+KSTM_MODULE_GLOBALS();
 
 static char pbl_buffer[PAGE_SIZE] __initdata;
 
index 7ac87f18a10ff8209ad58278a79548a91e059795..ad2bcfa8caa12376019b5a10c301e6edb21bb679 100644 (file)
@@ -30,8 +30,8 @@
 #define PAD_SIZE 16
 #define FILL_CHAR '$'
 
-static unsigned total_tests __initdata;
-static unsigned failed_tests __initdata;
+KSTM_MODULE_GLOBALS();
+
 static char *test_buffer __initdata;
 static char *alloced_buffer __initdata;