* [PATCH] microblaze: mb: Use str_yes_no() helper in show_cpuinfo()
@ 2024-11-14 22:46 Thorsten Blum
2024-11-15 9:28 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-11-14 22:46 UTC (permalink / raw)
To: Michal Simek, Thorsten Blum; +Cc: linux-kernel
Remove hard-coded strings by using the str_yes_no() helper function.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/microblaze/kernel/cpu/mb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
index 9581d194d9e4..37cb2898216b 100644
--- a/arch/microblaze/kernel/cpu/mb.c
+++ b/arch/microblaze/kernel/cpu/mb.c
@@ -66,10 +66,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
" MSR:\t\t%s\n"
" PCMP:\t\t%s\n"
" DIV:\t\t%s\n",
- (cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no",
- (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no",
- (cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no",
- (cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no");
+ str_yes_no(cpuinfo.use_instr & PVR0_USE_BARREL_MASK),
+ str_yes_no(cpuinfo.use_instr & PVR2_USE_MSR_INSTR),
+ str_yes_no(cpuinfo.use_instr & PVR2_USE_PCMP_INSTR),
+ str_yes_no(cpuinfo.use_instr & PVR0_USE_DIV_MASK));
seq_printf(m, " MMU:\t\t%x\n", cpuinfo.mmu);
@@ -120,7 +120,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m,
"HW-Debug:\t%s\n",
- cpuinfo.hw_debug ? "yes" : "no");
+ str_yes_no(cpuinfo.hw_debug));
seq_printf(m,
"PVR-USR1:\t%02x\n"
--
2.47.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] microblaze: mb: Use str_yes_no() helper in show_cpuinfo()
2024-11-14 22:46 [PATCH] microblaze: mb: Use str_yes_no() helper in show_cpuinfo() Thorsten Blum
@ 2024-11-15 9:28 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2024-11-15 9:28 UTC (permalink / raw)
To: Thorsten Blum; +Cc: linux-kernel
čt 14. 11. 2024 v 23:49 odesílatel Thorsten Blum
<thorsten.blum@linux.dev> napsal:
>
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/microblaze/kernel/cpu/mb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
> index 9581d194d9e4..37cb2898216b 100644
> --- a/arch/microblaze/kernel/cpu/mb.c
> +++ b/arch/microblaze/kernel/cpu/mb.c
> @@ -66,10 +66,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
> " MSR:\t\t%s\n"
> " PCMP:\t\t%s\n"
> " DIV:\t\t%s\n",
> - (cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no",
> - (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no",
> - (cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no",
> - (cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no");
> + str_yes_no(cpuinfo.use_instr & PVR0_USE_BARREL_MASK),
> + str_yes_no(cpuinfo.use_instr & PVR2_USE_MSR_INSTR),
> + str_yes_no(cpuinfo.use_instr & PVR2_USE_PCMP_INSTR),
> + str_yes_no(cpuinfo.use_instr & PVR0_USE_DIV_MASK));
>
> seq_printf(m, " MMU:\t\t%x\n", cpuinfo.mmu);
>
> @@ -120,7 +120,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>
> seq_printf(m,
> "HW-Debug:\t%s\n",
> - cpuinfo.hw_debug ? "yes" : "no");
> + str_yes_no(cpuinfo.hw_debug));
>
> seq_printf(m,
> "PVR-USR1:\t%02x\n"
> --
> 2.47.0
>
Applied.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-15 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 22:46 [PATCH] microblaze: mb: Use str_yes_no() helper in show_cpuinfo() Thorsten Blum
2024-11-15 9:28 ` Michal Simek
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.