* [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function
@ 2024-11-05 17:38 Thorsten Blum
2024-11-05 17:51 ` Thorsten Blum
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-11-05 17:38 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: Maciej W. Rozycki, Thorsten Blum, linux-mips, linux-kernel
Remove hard-coded strings by using the str_yes_no() helper function.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/mips/kernel/proc.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 8eba5a1ed664..8f0a0001540c 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -66,24 +66,23 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
cpu_data[n].udelay_val / (500000/HZ),
(cpu_data[n].udelay_val / (5000/HZ)) % 100);
- seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
+ seq_printf(m, "wait instruction\t: %s\n", str_yes_no(cpu_wait));
seq_printf(m, "microsecond timers\t: %s\n",
- cpu_has_counter ? "yes" : "no");
+ str_yes_no(cpu_has_counter));
seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
seq_printf(m, "extra interrupt vector\t: %s\n",
- cpu_has_divec ? "yes" : "no");
- seq_printf(m, "hardware watchpoint\t: %s",
- cpu_has_watch ? "yes, " : "no\n");
+ str_yes_no(cpu_has_divec));
+ seq_printf(m, "hardware watchpoint\t: %s", str_yes_no(cpu_has_watch));
if (cpu_has_watch) {
- seq_printf(m, "count: %d, address/irw mask: [",
+ seq_printf(m, ", count: %d, address/irw mask: [",
cpu_data[n].watch_reg_count);
for (i = 0; i < cpu_data[n].watch_reg_count; i++)
seq_printf(m, "%s0x%04x", i ? ", " : "",
cpu_data[n].watch_reg_masks[i]);
- seq_puts(m, "]\n");
+ seq_puts(m, "]");
}
- seq_puts(m, "isa\t\t\t:");
+ seq_puts(m, "\nisa\t\t\t:");
if (cpu_has_mips_1)
seq_puts(m, " mips1");
if (cpu_has_mips_2)
@@ -155,7 +154,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
if (cpu_has_mmips) {
seq_printf(m, "micromips kernel\t: %s\n",
- (read_c0_config3() & MIPS_CONF3_ISA_OE) ? "yes" : "no");
+ str_yes_no(read_c0_config3() & MIPS_CONF3_ISA_OE));
}
seq_puts(m, "Options implemented\t:");
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function
2024-11-05 17:38 [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function Thorsten Blum
@ 2024-11-05 17:51 ` Thorsten Blum
2024-11-05 19:13 ` Maciej W. Rozycki
2024-11-12 14:56 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-11-05 17:51 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: Maciej W. Rozycki, linux-mips, linux-kernel
On 5. Nov 2024, at 18:38, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Forgot the link to v1:
https://lore.kernel.org/r/20241102220437.22480-2-thorsten.blum@linux.dev/
And I just noticed the use of seq_printf(m,) vs. seq_puts(m,) and I'm
not sure this is still correct. Have to check this again later.
Sorry for the noise.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function
2024-11-05 17:38 [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function Thorsten Blum
2024-11-05 17:51 ` Thorsten Blum
@ 2024-11-05 19:13 ` Maciej W. Rozycki
2024-11-12 14:56 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2024-11-05 19:13 UTC (permalink / raw)
To: Thorsten Blum; +Cc: Thomas Bogendoerfer, linux-mips, linux-kernel
On Tue, 5 Nov 2024, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
LGTM, thanks!
Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function
2024-11-05 17:38 [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function Thorsten Blum
2024-11-05 17:51 ` Thorsten Blum
2024-11-05 19:13 ` Maciej W. Rozycki
@ 2024-11-12 14:56 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2024-11-12 14:56 UTC (permalink / raw)
To: Thorsten Blum; +Cc: Maciej W. Rozycki, linux-mips, linux-kernel
On Tue, Nov 05, 2024 at 06:38:36PM +0100, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/mips/kernel/proc.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-12 15:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 17:38 [PATCH v2] MIPS: kernel: proc: Use str_yes_no() helper function Thorsten Blum
2024-11-05 17:51 ` Thorsten Blum
2024-11-05 19:13 ` Maciej W. Rozycki
2024-11-12 14:56 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox