Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel/panic: return early from print_tainted() when not tainted

Reduce indent to make follow-up changes slightly easier on the eyes.

Link: https://lkml.kernel.org/r/01d6c03de1c9d1b52b59c652a3704a0a9886ed63.1717146197.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Jani Nikula and committed by
Andrew Morton
f4b62423 21516c56

+13 -12
+13 -12
kernel/panic.c
··· 507 507 const char *print_tainted(void) 508 508 { 509 509 static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")]; 510 + char *s; 511 + int i; 510 512 511 513 BUILD_BUG_ON(ARRAY_SIZE(taint_flags) != TAINT_FLAGS_COUNT); 512 514 513 - if (tainted_mask) { 514 - char *s; 515 - int i; 516 - 517 - s = buf + sprintf(buf, "Tainted: "); 518 - for (i = 0; i < TAINT_FLAGS_COUNT; i++) { 519 - const struct taint_flag *t = &taint_flags[i]; 520 - *s++ = test_bit(i, &tainted_mask) ? 521 - t->c_true : t->c_false; 522 - } 523 - *s = 0; 524 - } else 515 + if (!tainted_mask) { 525 516 snprintf(buf, sizeof(buf), "Not tainted"); 517 + return buf; 518 + } 519 + 520 + s = buf + sprintf(buf, "Tainted: "); 521 + for (i = 0; i < TAINT_FLAGS_COUNT; i++) { 522 + const struct taint_flag *t = &taint_flags[i]; 523 + *s++ = test_bit(i, &tainted_mask) ? 524 + t->c_true : t->c_false; 525 + } 526 + *s = 0; 526 527 527 528 return buf; 528 529 }