All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Hexagon-setup: Combine four seq_printf() calls into one call in show_cpuinfo()
@ 2016-10-21  6:33 ` SF Markus Elfring
  0 siblings, 0 replies; 18+ messages in thread
From: SF Markus Elfring @ 2016-10-21  6:33 UTC (permalink / raw)
  To: linux-hexagon, Richard Kuo; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 21 Oct 2016 08:18:38 +0200

Some data were printed into a sequence by four separate function calls.
Print the same data by a single function call instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/hexagon/kernel/setup.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c
index 6981949..ff37044 100644
--- a/arch/hexagon/kernel/setup.c
+++ b/arch/hexagon/kernel/setup.c
@@ -132,13 +132,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	if (!cpu_online(cpu))
 		return 0;
 #endif
-
-	seq_printf(m, "processor\t: %d\n", cpu);
-	seq_printf(m, "model name\t: Hexagon Virtual Machine\n");
-	seq_printf(m, "BogoMips\t: %lu.%02lu\n",
-		(loops_per_jiffy * HZ) / 500000,
-		((loops_per_jiffy * HZ) / 5000) % 100);
-	seq_printf(m, "\n");
+	seq_printf(m,
+		   "processor\t: %d\n"
+		   "model name\t: Hexagon Virtual Machine\n"
+		   "BogoMips\t: %lu.%02lu\n"
+		   "\n",
+		   cpu,
+		   (loops_per_jiffy * HZ) / 500000,
+		   ((loops_per_jiffy * HZ) / 5000) % 100);
 	return 0;
 }
 
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-10-25 21:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  6:33 [PATCH] Hexagon-setup: Combine four seq_printf() calls into one call in show_cpuinfo() SF Markus Elfring
2016-10-21  6:33 ` SF Markus Elfring
2016-10-21  7:20 ` Julia Lawall
2016-10-21  7:20   ` Julia Lawall
2016-10-21  9:00   ` SF Markus Elfring
2016-10-21  9:00     ` SF Markus Elfring
2016-10-21 15:46     ` Theodore Ts'o
2016-10-21 15:46       ` Theodore Ts'o
2016-10-21 17:33       ` SF Markus Elfring
2016-10-21 17:33         ` SF Markus Elfring
2016-10-21 17:53         ` Theodore Ts'o
2016-10-21 17:53           ` Theodore Ts'o
2016-10-21 18:28           ` SF Markus Elfring
2016-10-21 18:28             ` SF Markus Elfring
2016-10-21 18:50           ` SF Markus Elfring
2016-10-21 18:50             ` SF Markus Elfring
2016-10-25 21:37             ` Richard Kuo
2016-10-25 21:37               ` Richard Kuo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.