Long ago, Jiri Slaby noted that the subsequent printks should be
pr_cont. Let's instead get rid of the multiple printk calls.

Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>
---
I originally suggested getting rid of the extra printks by building a
suitable string at compile time, but then ended up going out on a
tangent. Since I've basically shelved the COND_CONFIG idea and
288cf3c64e anyway makes it impossible to build the entire string at
compile time, I now suggest this.

 arch/x86/kernel/dumpstack.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 8efa57a5f29e..2bb25c3fe2e8 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -260,19 +260,12 @@ int __die(const char *str, struct pt_regs *regs, long err)
        unsigned long sp;
 #endif
        printk(KERN_DEFAULT
-              "%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter);
-#ifdef CONFIG_PREEMPT
-       printk("PREEMPT ");
-#endif
-#ifdef CONFIG_SMP
-       printk("SMP ");
-#endif
-       if (debug_pagealloc_enabled())
-               printk("DEBUG_PAGEALLOC ");
-#ifdef CONFIG_KASAN
-       printk("KASAN");
-#endif
-       printk("\n");
+              "%s: %04lx [#%d]%s%s%s%s\n", str, err & 0xffff, ++die_counter,
+              IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT"         : "",
+              IS_ENABLED(CONFIG_SMP)     ? " SMP"             : "",
+              debug_pagealloc_enabled()  ? " DEBUG_PAGEALLOC" : "",
+              IS_ENABLED(CONFIG_KASAN)   ? " KASAN"           : "");
+
        if (notify_die(DIE_OOPS, str, regs, err,
                        current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)
                return 1;
-- 
2.1.4

Reply via email to