* [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo()
@ 2026-06-04 14:48 Markus Elfring
2026-06-04 14:50 ` [PATCH 1/3] LoongArch: Simplify " Markus Elfring
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Markus Elfring @ 2026-06-04 14:48 UTC (permalink / raw)
To: loongarch, George Guo, Hengqi Chen, Huacai Chen, Tiezhu Yang,
Wang Xuerui
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 Jun 2026 16:40:05 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Simplify data output
Delete unnecessary braces
Combine two seq_puts() calls
arch/loongarch/kernel/proc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] LoongArch: Simplify data output in show_cpuinfo()
2026-06-04 14:48 [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo() Markus Elfring
@ 2026-06-04 14:50 ` Markus Elfring
2026-06-04 14:51 ` [PATCH 2/3] LoongArch: Delete unnecessary braces " Markus Elfring
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-06-04 14:50 UTC (permalink / raw)
To: loongarch, George Guo, Hengqi Chen, Huacai Chen, Tiezhu Yang,
Wang Xuerui
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 Jun 2026 16:02:59 +0200
Move the specification for a line break from a seq_puts() call
to a seq_printf() call.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/loongarch/kernel/proc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
index d4ce5b585453..cc1b7a96bb0f 100644
--- a/arch/loongarch/kernel/proc.c
+++ b/arch/loongarch/kernel/proc.c
@@ -94,9 +94,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_puts(m, " lbt_arm");
if (cpu_has_lbt_mips)
seq_puts(m, " lbt_mips");
- seq_puts(m, "\n");
- seq_printf(m, "Hardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
+ seq_printf(m, "\nHardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
if (cpu_has_watch) {
seq_printf(m, ", iwatch count: %d, dwatch count: %d",
cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
--
2.54.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] LoongArch: Delete unnecessary braces in show_cpuinfo()
2026-06-04 14:48 [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo() Markus Elfring
2026-06-04 14:50 ` [PATCH 1/3] LoongArch: Simplify " Markus Elfring
@ 2026-06-04 14:51 ` Markus Elfring
2026-06-04 14:53 ` [PATCH 3/3] LoongArch: Combine two seq_puts() calls " Markus Elfring
2026-06-05 2:59 ` [PATCH 0/3] LoongArch: More efficient data output " Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-06-04 14:51 UTC (permalink / raw)
To: loongarch, George Guo, Hengqi Chen, Huacai Chen, Tiezhu Yang,
Wang Xuerui
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 Jun 2026 16:16:43 +0200
Do not use curly brackets at one source code place
where a single statement should be sufficient.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/loongarch/kernel/proc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
index cc1b7a96bb0f..bc1cd400025c 100644
--- a/arch/loongarch/kernel/proc.c
+++ b/arch/loongarch/kernel/proc.c
@@ -96,10 +96,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_puts(m, " lbt_mips");
seq_printf(m, "\nHardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
- if (cpu_has_watch) {
+ if (cpu_has_watch)
seq_printf(m, ", iwatch count: %d, dwatch count: %d",
cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
- }
seq_puts(m, "\n\n");
--
2.54.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] LoongArch: Combine two seq_puts() calls in show_cpuinfo()
2026-06-04 14:48 [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo() Markus Elfring
2026-06-04 14:50 ` [PATCH 1/3] LoongArch: Simplify " Markus Elfring
2026-06-04 14:51 ` [PATCH 2/3] LoongArch: Delete unnecessary braces " Markus Elfring
@ 2026-06-04 14:53 ` Markus Elfring
2026-06-05 2:59 ` [PATCH 0/3] LoongArch: More efficient data output " Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2026-06-04 14:53 UTC (permalink / raw)
To: loongarch, George Guo, Hengqi Chen, Huacai Chen, Tiezhu Yang,
Wang Xuerui
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 Jun 2026 16:33:07 +0200
Put data into a sequence by a single seq_puts() call instead of two.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/loongarch/kernel/proc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
index bc1cd400025c..36df3c7f6990 100644
--- a/arch/loongarch/kernel/proc.c
+++ b/arch/loongarch/kernel/proc.c
@@ -57,9 +57,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_puts(m, " loongarch32s");
if (isa & LOONGARCH_CPU_ISA_LA64)
seq_puts(m, " loongarch64");
- seq_puts(m, "\n");
- seq_puts(m, "Features\t\t:");
+ seq_puts(m, "\nFeatures\t\t:");
if (cpu_has_cpucfg)
seq_puts(m, " cpucfg");
if (cpu_has_lam)
--
2.54.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo()
2026-06-04 14:48 [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo() Markus Elfring
` (2 preceding siblings ...)
2026-06-04 14:53 ` [PATCH 3/3] LoongArch: Combine two seq_puts() calls " Markus Elfring
@ 2026-06-05 2:59 ` Huacai Chen
3 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2026-06-05 2:59 UTC (permalink / raw)
To: Markus Elfring
Cc: loongarch, George Guo, Hengqi Chen, Tiezhu Yang, Wang Xuerui,
LKML, kernel-janitors
Hi, Markus,
I suggest squash these pieces to a single patch.
Huacai
On Thu, Jun 4, 2026 at 10:48 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 4 Jun 2026 16:40:05 +0200
>
> A few update suggestions were taken into account
> from static source code analysis.
>
> Markus Elfring (3):
> Simplify data output
> Delete unnecessary braces
> Combine two seq_puts() calls
>
> arch/loongarch/kernel/proc.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-05 2:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 14:48 [PATCH 0/3] LoongArch: More efficient data output in show_cpuinfo() Markus Elfring
2026-06-04 14:50 ` [PATCH 1/3] LoongArch: Simplify " Markus Elfring
2026-06-04 14:51 ` [PATCH 2/3] LoongArch: Delete unnecessary braces " Markus Elfring
2026-06-04 14:53 ` [PATCH 3/3] LoongArch: Combine two seq_puts() calls " Markus Elfring
2026-06-05 2:59 ` [PATCH 0/3] LoongArch: More efficient data output " Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®