Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754916AbcJUHUP (ORCPT ); Fri, 21 Oct 2016 03:20:15 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:8416 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbcJUHUK (ORCPT ); Fri, 21 Oct 2016 03:20:10 -0400 X-IronPort-AV: E=Sophos;i="5.31,375,1473112800"; d="scan'208";a="197616289" Date: Fri, 21 Oct 2016 09:20:03 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: SF Markus Elfring cc: linux-hexagon@vger.kernel.org, Richard Kuo , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] Hexagon-setup: Combine four seq_printf() calls into one call in show_cpuinfo() In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1750 Lines: 59 On Fri, 21 Oct 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 21 Oct 2016 08:18:38 +0200 > > Some data were printed into a sequence by four separate function calls. > Print the same data by a single function call instead. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > arch/hexagon/kernel/setup.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c > index 6981949..ff37044 100644 > --- a/arch/hexagon/kernel/setup.c > +++ b/arch/hexagon/kernel/setup.c > @@ -132,13 +132,14 @@ static int show_cpuinfo(struct seq_file *m, void *v) > if (!cpu_online(cpu)) > return 0; > #endif > - > - seq_printf(m, "processor\t: %d\n", cpu); > - seq_printf(m, "model name\t: Hexagon Virtual Machine\n"); > - seq_printf(m, "BogoMips\t: %lu.%02lu\n", > - (loops_per_jiffy * HZ) / 500000, > - ((loops_per_jiffy * HZ) / 5000) % 100); > - seq_printf(m, "\n"); > + seq_printf(m, > + "processor\t: %d\n" > + "model name\t: Hexagon Virtual Machine\n" > + "BogoMips\t: %lu.%02lu\n" > + "\n", > + cpu, > + (loops_per_jiffy * HZ) / 500000, > + ((loops_per_jiffy * HZ) / 5000) % 100); This looks completely pointless. It is harder to see how the arguments fit into the strings and it is harder to see where the strings end and the arguments begin. julia > return 0; > } > > -- > 2.10.1 > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >