linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: "Linux MIPS Mailing List" <linux-mips@linux-mips.org>,
	"Andrea Gelmini" <andrea.gelmini@gelma.net>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Leonid Yegoshin" <Leonid.Yegoshin@imgtec.com>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Matt Redfearn" <matt.redfearn@imgtec.com>,
	"Paul Burton" <paul.burton@imgtec.com>,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>,
	"Ralf Bächle" <ralf@linux-mips.org>,
	"Zubair Lutfullah Kakakhel" <Zubair.Kakakhel@imgtec.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls into one call in show_cpuinfo()
Date: Tue, 25 Oct 2016 10:55:42 +0200	[thread overview]
Message-ID: <CAMuHMdXn2gss2MRP7j1pAcmcXL_VivGQqMw1mAu-PUaRxGER0w@mail.gmail.com> (raw)
In-Reply-To: <61796ee0-b3b8-53a6-d29d-487c89145fc1@users.sourceforge.net>

On Mon, Oct 24, 2016 at 2:30 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 24 Oct 2016 13:54:58 +0200
>
> Some data were printed into a sequence by four separate function calls.
> Print the same data by one function call instead.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  arch/mips/kernel/proc.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
> index 07480a9..1047a03 100644
> --- a/arch/mips/kernel/proc.c
> +++ b/arch/mips/kernel/proc.c
> @@ -142,12 +142,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>                 seq_printf(m, "micromips kernel\t: %s\n",
>                       (read_c0_config3() & MIPS_CONF3_ISA_OE) ?  "yes" : "no");
>         }
> -       seq_printf(m, "shadow register sets\t: %d\n",
> -                     cpu_data[n].srsets);
> -       seq_printf(m, "kscratch registers\t: %d\n",
> -                     hweight8(cpu_data[n].kscratch_mask));
> -       seq_printf(m, "package\t\t\t: %d\n", cpu_data[n].package);
> -       seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
> +       seq_printf(m,
> +                  "shadow register sets\t: %d\n"
> +                  "kscratch registers\t: %d\n"
> +                  "package\t\t\t: %d\n"
> +                  "core\t\t\t: %d\n",
> +                  cpu_data[n].srsets,
> +                  hweight8(cpu_data[n].kscratch_mask),
> +                  cpu_data[n].package,
> +                  cpu_data[n].core);

I think the code is much easier to read with separate seq_printf()s for
each line printed.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2016-10-25  8:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 12:26 [PATCH 0/4] MIPS-kernel: Fine-tuning for two function implementations SF Markus Elfring
2016-10-24 12:27 ` [PATCH 1/4] MIPS/kernel/r2-to-r6-emul: Use seq_puts() in mipsr2_stats_show() SF Markus Elfring
2016-10-24 13:13   ` Theodore Ts'o
2016-10-24 14:02     ` SF Markus Elfring
2016-10-24 14:20       ` Theodore Ts'o
2016-10-24 14:53         ` SF Markus Elfring
2016-10-24 15:51           ` Theodore Ts'o
2016-10-24 18:10             ` Further software improvements around Linux sequence API? SF Markus Elfring
2016-10-24 12:28 ` [PATCH 2/4] MIPS/kernel/proc: Use seq_putc() in show_cpuinfo() SF Markus Elfring
2016-10-24 12:29 ` [PATCH 3/4] MIPS/kernel/proc: Replace 28 seq_printf() calls by seq_puts() " SF Markus Elfring
2016-10-24 12:30 ` [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls into one call " SF Markus Elfring
2016-10-25  8:55   ` Geert Uytterhoeven [this message]
2016-10-25  9:08     ` Ralf Baechle

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=CAMuHMdXn2gss2MRP7j1pAcmcXL_VivGQqMw1mAu-PUaRxGER0w@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea.gelmini@gelma.net \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matt.redfearn@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=ralf@linux-mips.org \
    --cc=yamada.masahiro@socionext.com \
    /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;
as well as URLs for NNTP newsgroup(s).