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


Groups > linux.kernel > #1507144

[PATCH 2/4] MIPS/kernel/proc: Use seq_putc() in show_cpuinfo()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/4] MIPS/kernel/proc: Use seq_putc() in show_cpuinfo()
Date 2016-10-24 14:30 +0200
Message-ID <svMy6-7xJ-21@gated-at.bofh.it> (permalink)
References <svMy5-7xJ-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 24 Oct 2016 12:54:15 +0200

A few single characters (line breaks) should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/mips/kernel/proc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 4eff2ae..765489b 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -122,7 +122,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	if (cpu_has_eva)	seq_printf(m, "%s", " eva");
 	if (cpu_has_htw)	seq_printf(m, "%s", " htw");
 	if (cpu_has_xpa)	seq_printf(m, "%s", " xpa");
-	seq_printf(m, "\n");
+	seq_putc(m, '\n');
 
 	if (cpu_has_mmips) {
 		seq_printf(m, "micromips kernel\t: %s\n",
@@ -152,9 +152,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 	raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
 				&proc_cpuinfo_notifier_args);
-
-	seq_printf(m, "\n");
-
+	seq_putc(m, '\n');
 	return 0;
 }
 
-- 
2.10.1

Back to linux.kernel | Previous | Next — Previous in thread | Next 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