Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1508093
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| 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 | Tue, 25 Oct 2016 11:10:02 +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> |
| X-Original-To | Geert Uytterhoeven <geert@linux-m68k.org> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.7.1 (2016-10-04) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 25 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | SF Markus Elfring <elfring@users.sourceforge.net>, 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>, Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>, LKML <linux-kernel@vger.kernel.org>, "kernel-janitors@vger.kernel.org" <kernel-janitors@vger.kernel.org> |
| X-Original-Date | Tue, 25 Oct 2016 11:08:22 +0200 |
| X-Original-Message-ID | <20161025090822.GB4795@linux-mips.org> |
| X-Original-References | <3809e713-2f08-db60-92c1-21d735a4f35b@users.sourceforge.net> <61796ee0-b3b8-53a6-d29d-487c89145fc1@users.sourceforge.net> <CAMuHMdXn2gss2MRP7j1pAcmcXL_VivGQqMw1mAu-PUaRxGER0w@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1508093 |
Show key headers only | 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
[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