s390/test_unwind: add WARN if tests failed
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Apr 2021 22:31:47 +0000 (00:31 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 12 Apr 2021 10:46:44 +0000 (12:46 +0200)
Trigger a warning if any of unwinder tests fail. This should help to
prevent quiet ignoring of test results when panic_on_warn is enabled.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/lib/test_unwind.c

index 54b36e71ddf304f1f36d94bc6907a96c9e3b8f0d..eda72bc49c79f296fa36bb4d4007e4cf49ba8c57 100644 (file)
@@ -296,16 +296,18 @@ static int test_unwind_flags(int flags)
 
 static int test_unwind_init(void)
 {
-       int ret = 0;
+       int failed = 0;
+       int total = 0;
 
 #define TEST(flags)                                                    \
 do {                                                                   \
        pr_info("[ RUN      ] " #flags "\n");                           \
+       total++;                                                        \
        if (!test_unwind_flags((flags))) {                              \
                pr_info("[       OK ] " #flags "\n");                   \
        } else {                                                        \
                pr_err("[  FAILED  ] " #flags "\n");                    \
-               ret = -EINVAL;                                          \
+               failed++;                                               \
        }                                                               \
 } while (0)
 
@@ -336,7 +338,8 @@ do {                                                                        \
 #endif
 #undef TEST
 
-       return ret;
+       WARN(failed, "%d of %d unwinder tests failed", failed, total);
+       return failed ? -EINVAL : 0;
 }
 
 static void test_unwind_exit(void)