1

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>
This commit is contained in:
Jani Nikula 2024-05-31 12:04:54 +03:00 committed by Andrew Morton
parent 21516c56ff
commit f4b6242338

View File

@ -507,12 +507,15 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
const char *print_tainted(void)
{
static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")];
char *s;
int i;
BUILD_BUG_ON(ARRAY_SIZE(taint_flags) != TAINT_FLAGS_COUNT);
if (tainted_mask) {
char *s;
int i;
if (!tainted_mask) {
snprintf(buf, sizeof(buf), "Not tainted");
return buf;
}
s = buf + sprintf(buf, "Tainted: ");
for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
@ -521,8 +524,6 @@ const char *print_tainted(void)
t->c_true : t->c_false;
}
*s = 0;
} else
snprintf(buf, sizeof(buf), "Not tainted");
return buf;
}