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 4425a1d..0ea0e82 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 7ac87f1..ad2bcfa 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;