Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752464AbdLKRpJ (ORCPT ); Mon, 11 Dec 2017 12:45:09 -0500 Received: from mail.skyhub.de ([5.9.137.197]:55732 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbdLKRpG (ORCPT ); Mon, 11 Dec 2017 12:45:06 -0500 Date: Mon, 11 Dec 2017 18:45:00 +0100 From: Borislav Petkov To: Sergey Senozhatsky Cc: Andrew Morton , Russell King , Catalin Marinas , Mark Salter , Tony Luck , David Howells , Yoshinori Sato , Guan Xuetao , Greg Kroah-Hartman , Thomas Gleixner , Peter Zijlstra , Vineet Gupta , Fengguang Wu , Steven Rostedt , Petr Mladek , LKML , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-am33-list@redhat.com, linux-sh@vger.kernel.org, linux-edac@vger.kernel.org, x86@kernel.org, linux-snps-arc@lists.infradead.org, Sergey Senozhatsky Subject: Re: [PATCH 08/13] x86: do not use print_symbol() Message-ID: <20171211174459.l2ugmyi6kcr33zxp@pd.tnic> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> <20171211125025.2270-9-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171211125025.2270-9-sergey.senozhatsky@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1527 Lines: 53 On Mon, Dec 11, 2017 at 09:50:20PM +0900, Sergey Senozhatsky wrote: > print_symbol() uses extra stack space to sprintf() symbol > information and then to feed that buffer to printk() > > char buffer[KSYM_SYMBOL_LEN]; > > sprint_symbol(buffer, address); > printk(fmt, buffer); > > Replace print_symbol() with a direct printk("%pS") call. > > Signed-off-by: Sergey Senozhatsky > Cc: Tony Luck > Cc: Borislav Petkov > Cc: Thomas Gleixner > --- > arch/x86/kernel/cpu/mcheck/mce.c | 3 +-- > arch/x86/mm/mmio-mod.c | 5 ++--- > 2 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c > index b1d616d08eee..8ca8f6eb32db 100644 > --- a/arch/x86/kernel/cpu/mcheck/mce.c > +++ b/arch/x86/kernel/cpu/mcheck/mce.c > @@ -14,7 +14,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -235,7 +234,7 @@ static void __print_mce(struct mce *m) > m->cs, m->ip); > > if (m->cs == __KERNEL_CS) > - print_symbol("{%s}", m->ip); > + pr_cont("{%pS}", (void *)m->ip); > pr_cont("\n"); > } > For the mce.c bit above: Acked-by: Borislav Petkov Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.