From: Julia Lawall <julia.lawall@lip6.fr>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-hexagon@vger.kernel.org, Richard Kuo <rkuo@codeaurora.org>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Hexagon-setup: Combine four seq_printf() calls into one call in show_cpuinfo()
Date: Fri, 21 Oct 2016 09:20:03 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1610210918420.3212@hadrien> (raw)
In-Reply-To: <c19c69d5-600c-f08b-f448-0420e677db63@users.sourceforge.net>
On Fri, 21 Oct 2016, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
> 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
>
next prev parent reply other threads:[~2016-10-21 7:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 6:33 SF Markus Elfring
2016-10-21 7:20 ` Julia Lawall [this message]
2016-10-21 9:00 ` SF Markus Elfring
2016-10-21 15:46 ` Theodore Ts'o
2016-10-21 17:33 ` SF Markus Elfring
2016-10-21 17:53 ` Theodore Ts'o
2016-10-21 18:28 ` SF Markus Elfring
2016-10-21 18:50 ` SF Markus Elfring
2016-10-25 21:37 ` Richard Kuo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.10.1610210918420.3212@hadrien \
--to=julia.lawall@lip6.fr \
--cc=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkuo@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®