Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1508093

Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls into one call in show_cpuinfo()

From Ralf Baechle <ralf@linux-mips.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls into one call in show_cpuinfo()
Date 2016-10-25 11:10 +0200
Message-ID <sw5U6-3BL-21@gated-at.bofh.it> (permalink)
References <svMy5-7xJ-9@gated-at.bofh.it> <svMHM-7B9-57@gated-at.bofh.it> <sw5Kp-3jn-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 25, 2016 at 10:55:42AM +0200, Geert Uytterhoeven wrote:

> > -       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.

Which is why I originally implemented this as separate function calls.
Code size and performance are hardly an argument for /proc/cpuinfo.

  Ralf

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] MIPS-kernel: Fine-tuning for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-24 14:30 +0200
  [PATCH 2/4] MIPS/kernel/proc: Use seq_putc() in show_cpuinfo() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-24 14:30 +0200
  [PATCH 3/4] MIPS/kernel/proc: Replace 28 seq_printf() calls by  seq_puts() in show_cpuinfo() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-24 14:40 +0200
  [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls into  one call in show_cpuinfo() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-24 14:40 +0200
    Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls  into one call in show_cpuinfo() Geert Uytterhoeven <geert@linux-m68k.org> - 2016-10-25 11:00 +0200
      Re: [PATCH 4/4] MIPS/kernel/proc: Combine four seq_printf() calls  into one call in show_cpuinfo() Ralf Baechle <ralf@linux-mips.org> - 2016-10-25 11:10 +0200

csiph-web