|
1 | 1 | // SPDX-License-Identifier: GPL-2.0
|
2 | 2 | /*
|
3 |
| - * arch/x86/kernel/nmi-selftest.c |
4 |
| - * |
5 | 3 | * Testsuite for NMI: IPIs
|
6 | 4 | *
|
7 | 5 | * Started by Don Zickus:
|
@@ -30,7 +28,6 @@ static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata;
|
30 | 28 |
|
31 | 29 | static int __initdata testcase_total;
|
32 | 30 | static int __initdata testcase_successes;
|
33 |
| -static int __initdata expected_testcase_failures; |
34 | 31 | static int __initdata unexpected_testcase_failures;
|
35 | 32 | static int __initdata unexpected_testcase_unknowns;
|
36 | 33 |
|
@@ -120,65 +117,48 @@ static void __init dotest(void (*testcase_fn)(void), int expected)
|
120 | 117 | unexpected_testcase_failures++;
|
121 | 118 |
|
122 | 119 | if (nmi_fail == FAILURE)
|
123 |
| - printk(KERN_CONT "FAILED |"); |
| 120 | + pr_cont("FAILED |"); |
124 | 121 | else if (nmi_fail == TIMEOUT)
|
125 |
| - printk(KERN_CONT "TIMEOUT|"); |
| 122 | + pr_cont("TIMEOUT|"); |
126 | 123 | else
|
127 |
| - printk(KERN_CONT "ERROR |"); |
| 124 | + pr_cont("ERROR |"); |
128 | 125 | dump_stack();
|
129 | 126 | } else {
|
130 | 127 | testcase_successes++;
|
131 |
| - printk(KERN_CONT " ok |"); |
| 128 | + pr_cont(" ok |"); |
132 | 129 | }
|
133 |
| - testcase_total++; |
| 130 | + pr_cont("\n"); |
134 | 131 |
|
| 132 | + testcase_total++; |
135 | 133 | reset_nmi();
|
136 | 134 | }
|
137 | 135 |
|
138 |
| -static inline void __init print_testname(const char *testname) |
139 |
| -{ |
140 |
| - printk("%12s:", testname); |
141 |
| -} |
142 |
| - |
143 | 136 | void __init nmi_selftest(void)
|
144 | 137 | {
|
145 | 138 | init_nmi_testsuite();
|
146 | 139 |
|
147 | 140 | /*
|
148 | 141 | * Run the testsuite:
|
149 | 142 | */
|
150 |
| - printk("----------------\n"); |
151 |
| - printk("| NMI testsuite:\n"); |
152 |
| - printk("--------------------\n"); |
| 143 | + pr_info("----------------\n"); |
| 144 | + pr_info("| NMI testsuite:\n"); |
| 145 | + pr_info("--------------------\n"); |
153 | 146 |
|
154 |
| - print_testname("remote IPI"); |
| 147 | + pr_info("%12s:", "remote IPI"); |
155 | 148 | dotest(remote_ipi, SUCCESS);
|
156 |
| - printk(KERN_CONT "\n"); |
157 |
| - print_testname("local IPI"); |
| 149 | + |
| 150 | + pr_info("%12s:", "local IPI"); |
158 | 151 | dotest(local_ipi, SUCCESS);
|
159 |
| - printk(KERN_CONT "\n"); |
160 | 152 |
|
161 | 153 | cleanup_nmi_testsuite();
|
162 | 154 |
|
| 155 | + pr_info("--------------------\n"); |
163 | 156 | if (unexpected_testcase_failures) {
|
164 |
| - printk("--------------------\n"); |
165 |
| - printk("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n", |
| 157 | + pr_info("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n", |
166 | 158 | unexpected_testcase_failures, testcase_total);
|
167 |
| - printk("-----------------------------------------------------------------\n"); |
168 |
| - } else if (expected_testcase_failures && testcase_successes) { |
169 |
| - printk("--------------------\n"); |
170 |
| - printk("%3d out of %3d testcases failed, as expected. |\n", |
171 |
| - expected_testcase_failures, testcase_total); |
172 |
| - printk("----------------------------------------------------\n"); |
173 |
| - } else if (expected_testcase_failures && !testcase_successes) { |
174 |
| - printk("--------------------\n"); |
175 |
| - printk("All %3d testcases failed, as expected. |\n", |
176 |
| - expected_testcase_failures); |
177 |
| - printk("----------------------------------------\n"); |
178 | 159 | } else {
|
179 |
| - printk("--------------------\n"); |
180 |
| - printk("Good, all %3d testcases passed! |\n", |
| 160 | + pr_info("Good, all %3d testcases passed! |\n", |
181 | 161 | testcase_successes);
|
182 |
| - printk("---------------------------------\n"); |
183 | 162 | }
|
| 163 | + pr_info("-----------------------------------------------------------------\n"); |
184 | 164 | }
|
0 commit comments