lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXn2gss2MRP7j1pAcmcXL_VivGQqMw1mAu-PUaRxGER0w@mail.gmail.com>
Date:   Tue, 25 Oct 2016 10:55:42 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:     Linux MIPS Mailing List <linux-mips@...ux-mips.org>,
        Andrea Gelmini <andrea.gelmini@...ma.net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Leonid Yegoshin <Leonid.Yegoshin@...tec.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Matt Redfearn <matt.redfearn@...tec.com>,
        Paul Burton <paul.burton@...tec.com>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Ralf Bächle <ralf@...ux-mips.org>,
        Zubair Lutfullah Kakakhel <Zubair.Kakakhel@...tec.com>,
        LKML <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls
 into one call in show_cpuinfo()

On Mon, Oct 24, 2016 at 2:30 PM, SF Markus Elfring
<elfring@...rs.sourceforge.net> wrote:
> From: Markus Elfring <elfring@...rs.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@...rs.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@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ