From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbcCZUkp (ORCPT ); Sat, 26 Mar 2016 16:40:45 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36534 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753640AbcCZUkm (ORCPT ); Sat, 26 Mar 2016 16:40:42 -0400 From: Rasmus Villemoes To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Cc: Jiri Slaby , Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH] x86: dumpstack: combine some printks Date: Sat, 26 Mar 2016 21:40:16 +0100 Message-Id: <1459024817-27122-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444165543-2209-2-git-send-email-linux@rasmusvillemoes.dk> References: <1444165543-2209-2-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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