* [PATCH 0/2] M32R-setup: Fine-tuning for show_cpuinfo()
@ 2016-10-23 20:22 SF Markus Elfring
2016-10-23 20:23 ` [PATCH 1/2] M32R-setup: Use seq_putc() in show_cpuinfo() SF Markus Elfring
2016-10-23 20:24 ` [PATCH 2/2] M32R-setup: Replace 16 seq_printf() calls by seq_puts() " SF Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2016-10-23 20:22 UTC (permalink / raw)
To: Andrew Morton, Ingo Molnar, Sudip Mukherjee, Toshi Kani
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 23 Oct 2016 22:15:22 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Use seq_putc()
Replace 16 seq_printf() calls by seq_puts()
arch/m32r/kernel/setup.c | 54 ++++++++++++++++++++++++++----------------------
1 file changed, 29 insertions(+), 25 deletions(-)
--
2.10.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] M32R-setup: Use seq_putc() in show_cpuinfo()
2016-10-23 20:22 [PATCH 0/2] M32R-setup: Fine-tuning for show_cpuinfo() SF Markus Elfring
@ 2016-10-23 20:23 ` SF Markus Elfring
2016-10-23 20:24 ` [PATCH 2/2] M32R-setup: Replace 16 seq_printf() calls by seq_puts() " SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2016-10-23 20:23 UTC (permalink / raw)
To: Andrew Morton, Ingo Molnar, Sudip Mukherjee, Toshi Kani
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 23 Oct 2016 21:50:22 +0200
A single character (line break) 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/m32r/kernel/setup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 136c69f..92cbe92 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -351,9 +351,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
PRINT_CLOCK("CPU", (int)c->cpu_clock);
PRINT_CLOCK("Bus", (int)c->bus_clock);
-
- seq_printf(m, "\n");
-
+ seq_putc(m, '\n');
return 0;
}
--
2.10.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] M32R-setup: Replace 16 seq_printf() calls by seq_puts() in show_cpuinfo()
2016-10-23 20:22 [PATCH 0/2] M32R-setup: Fine-tuning for show_cpuinfo() SF Markus Elfring
2016-10-23 20:23 ` [PATCH 1/2] M32R-setup: Use seq_putc() in show_cpuinfo() SF Markus Elfring
@ 2016-10-23 20:24 ` SF Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2016-10-23 20:24 UTC (permalink / raw)
To: Andrew Morton, Ingo Molnar, Sudip Mukherjee, Toshi Kani
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 23 Oct 2016 22:04:34 +0200
Strings which did not contain data format specifications should be put
into a sequence. Thus use the corresponding function "seq_puts".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/m32r/kernel/setup.c | 50 +++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 22 deletions(-)
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 92cbe92..2eac3b2 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -302,47 +302,53 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "processor\t: %ld\n", cpu);
#if defined(CONFIG_CHIP_VDEC2)
- seq_printf(m, "cpu family\t: VDEC2\n"
- "cache size\t: Unknown\n");
+ seq_puts(m,
+ "cpu family\t: VDEC2\n"
+ "cache size\t: Unknown\n");
#elif defined(CONFIG_CHIP_M32700)
- seq_printf(m,"cpu family\t: M32700\n"
- "cache size\t: I-8KB/D-8KB\n");
+ seq_puts(m,
+ "cpu family\t: M32700\n"
+ "cache size\t: I-8KB/D-8KB\n");
#elif defined(CONFIG_CHIP_M32102)
- seq_printf(m,"cpu family\t: M32102\n"
- "cache size\t: I-8KB\n");
+ seq_puts(m,
+ "cpu family\t: M32102\n"
+ "cache size\t: I-8KB\n");
#elif defined(CONFIG_CHIP_OPSP)
- seq_printf(m,"cpu family\t: OPSP\n"
- "cache size\t: I-8KB/D-8KB\n");
+ seq_puts(m,
+ "cpu family\t: OPSP\n"
+ "cache size\t: I-8KB/D-8KB\n");
#elif defined(CONFIG_CHIP_MP)
- seq_printf(m, "cpu family\t: M32R-MP\n"
- "cache size\t: I-xxKB/D-xxKB\n");
+ seq_puts(m,
+ "cpu family\t: M32R-MP\n"
+ "cache size\t: I-xxKB/D-xxKB\n");
#elif defined(CONFIG_CHIP_M32104)
- seq_printf(m,"cpu family\t: M32104\n"
- "cache size\t: I-8KB/D-8KB\n");
+ seq_puts(m,
+ "cpu family\t: M32104\n"
+ "cache size\t: I-8KB/D-8KB\n");
#else
- seq_printf(m, "cpu family\t: Unknown\n");
+ seq_puts(m, "cpu family\t: Unknown\n");
#endif
seq_printf(m, "bogomips\t: %lu.%02lu\n",
c->loops_per_jiffy/(500000/HZ),
(c->loops_per_jiffy/(5000/HZ)) % 100);
#if defined(CONFIG_PLAT_MAPPI)
- seq_printf(m, "Machine\t\t: Mappi Evaluation board\n");
+ seq_puts(m, "Machine\t\t: Mappi Evaluation board\n");
#elif defined(CONFIG_PLAT_MAPPI2)
- seq_printf(m, "Machine\t\t: Mappi-II Evaluation board\n");
+ seq_puts(m, "Machine\t\t: Mappi-II Evaluation board\n");
#elif defined(CONFIG_PLAT_MAPPI3)
- seq_printf(m, "Machine\t\t: Mappi-III Evaluation board\n");
+ seq_puts(m, "Machine\t\t: Mappi-III Evaluation board\n");
#elif defined(CONFIG_PLAT_M32700UT)
- seq_printf(m, "Machine\t\t: M32700UT Evaluation board\n");
+ seq_puts(m, "Machine\t\t: M32700UT Evaluation board\n");
#elif defined(CONFIG_PLAT_OPSPUT)
- seq_printf(m, "Machine\t\t: OPSPUT Evaluation board\n");
+ seq_puts(m, "Machine\t\t: OPSPUT Evaluation board\n");
#elif defined(CONFIG_PLAT_USRV)
- seq_printf(m, "Machine\t\t: uServer\n");
+ seq_puts(m, "Machine\t\t: uServer\n");
#elif defined(CONFIG_PLAT_OAKS32R)
- seq_printf(m, "Machine\t\t: OAKS32R\n");
+ seq_puts(m, "Machine\t\t: OAKS32R\n");
#elif defined(CONFIG_PLAT_M32104UT)
- seq_printf(m, "Machine\t\t: M3T-M32104UT uT Engine board\n");
+ seq_puts(m, "Machine\t\t: M3T-M32104UT uT Engine board\n");
#else
- seq_printf(m, "Machine\t\t: Unknown\n");
+ seq_puts(m, "Machine\t\t: Unknown\n");
#endif
#define PRINT_CLOCK(name, value) \
--
2.10.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-23 20:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-23 20:22 [PATCH 0/2] M32R-setup: Fine-tuning for show_cpuinfo() SF Markus Elfring
2016-10-23 20:23 ` [PATCH 1/2] M32R-setup: Use seq_putc() in show_cpuinfo() SF Markus Elfring
2016-10-23 20:24 ` [PATCH 2/2] M32R-setup: Replace 16 seq_printf() calls by seq_puts() " SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).