aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index e6480e20379e..c51edaa04fce 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -298,30 +298,27 @@ void panic(const char *fmt, ...)
298 298
299EXPORT_SYMBOL(panic); 299EXPORT_SYMBOL(panic);
300 300
301 301/*
302struct tnt { 302 * TAINT_FORCED_RMMOD could be a per-module flag but the module
303 u8 bit; 303 * is being removed anyway.
304 char true; 304 */
305 char false; 305const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
306}; 306 { 'P', 'G', true }, /* TAINT_PROPRIETARY_MODULE */
307 307 { 'F', ' ', true }, /* TAINT_FORCED_MODULE */
308static const struct tnt tnts[] = { 308 { 'S', ' ', false }, /* TAINT_CPU_OUT_OF_SPEC */
309 { TAINT_PROPRIETARY_MODULE, 'P', 'G' }, 309 { 'R', ' ', false }, /* TAINT_FORCED_RMMOD */
310 { TAINT_FORCED_MODULE, 'F', ' ' }, 310 { 'M', ' ', false }, /* TAINT_MACHINE_CHECK */
311 { TAINT_CPU_OUT_OF_SPEC, 'S', ' ' }, 311 { 'B', ' ', false }, /* TAINT_BAD_PAGE */
312 { TAINT_FORCED_RMMOD, 'R', ' ' }, 312 { 'U', ' ', false }, /* TAINT_USER */
313 { TAINT_MACHINE_CHECK, 'M', ' ' }, 313 { 'D', ' ', false }, /* TAINT_DIE */
314 { TAINT_BAD_PAGE, 'B', ' ' }, 314 { 'A', ' ', false }, /* TAINT_OVERRIDDEN_ACPI_TABLE */
315 { TAINT_USER, 'U', ' ' }, 315 { 'W', ' ', false }, /* TAINT_WARN */
316 { TAINT_DIE, 'D', ' ' }, 316 { 'C', ' ', true }, /* TAINT_CRAP */
317 { TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' }, 317 { 'I', ' ', false }, /* TAINT_FIRMWARE_WORKAROUND */
318 { TAINT_WARN, 'W', ' ' }, 318 { 'O', ' ', true }, /* TAINT_OOT_MODULE */
319 { TAINT_CRAP, 'C', ' ' }, 319 { 'E', ' ', true }, /* TAINT_UNSIGNED_MODULE */
320 { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' }, 320 { 'L', ' ', false }, /* TAINT_SOFTLOCKUP */
321 { TAINT_OOT_MODULE, 'O', ' ' }, 321 { 'K', ' ', true }, /* TAINT_LIVEPATCH */
322 { TAINT_UNSIGNED_MODULE, 'E', ' ' },
323 { TAINT_SOFTLOCKUP, 'L', ' ' },
324 { TAINT_LIVEPATCH, 'K', ' ' },
325}; 322};
326 323
327/** 324/**
@@ -348,16 +345,16 @@ static const struct tnt tnts[] = {
348 */ 345 */
349const char *print_tainted(void) 346const char *print_tainted(void)
350{ 347{
351 static char buf[ARRAY_SIZE(tnts) + sizeof("Tainted: ")]; 348 static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")];
352 349
353 if (tainted_mask) { 350 if (tainted_mask) {
354 char *s; 351 char *s;
355 int i; 352 int i;
356 353
357 s = buf + sprintf(buf, "Tainted: "); 354 s = buf + sprintf(buf, "Tainted: ");
358 for (i = 0; i < ARRAY_SIZE(tnts); i++) { 355 for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
359 const struct tnt *t = &tnts[i]; 356 const struct taint_flag *t = &taint_flags[i];
360 *s++ = test_bit(t->bit, &tainted_mask) ? 357 *s++ = test_bit(i, &tainted_mask) ?
361 t->true : t->false; 358 t->true : t->false;
362 } 359 }
363 *s = 0; 360 *s = 0;