Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935747AbcJQQ0P (ORCPT ); Mon, 17 Oct 2016 12:26:15 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:49128 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932727AbcJQQ0F (ORCPT ); Mon, 17 Oct 2016 12:26:05 -0400 Subject: Re: [PATCH] ARC-setup: Use seq_putc() in show_cpuinfo() To: SF Markus Elfring , "linux-snps-arc@lists.infradead.org" , Alexey Brodkin , Andrea Gelmini , Kefeng Wang , "Noam Camus" , Vineet Gupta References: <164a402a-de20-645d-00af-9a414cf745c4@users.sourceforge.net> CC: LKML , "kernel-janitors@vger.kernel.org" From: Vineet Gupta Message-ID: <579aaf85-c22d-b680-5ce8-3c0e23ab6d7e@synopsys.com> Date: Mon, 17 Oct 2016 09:25:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <164a402a-de20-645d-00af-9a414cf745c4@users.sourceforge.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.161.50] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1005 Lines: 33 On 10/15/2016 12:56 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sat, 15 Oct 2016 21:31:16 +0200 > > A single character (line break) should be put into a sequence. > Thus use the corresponding function "seq_putc". Perhaps reword the changelog to say that seqc_putc is more efficient than seqc_printf to output a single char. I mean _printf is not wrong but not as efficient ? > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > arch/arc/kernel/setup.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c > index 3df7f9c..e3f5432 100644 > --- a/arch/arc/kernel/setup.c > +++ b/arch/arc/kernel/setup.c > @@ -494,8 +494,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) > > free_page((unsigned long)str); > done: > - seq_printf(m, "\n"); > - > + seq_putc(m, '\n'); > return 0; > } >