Skip to contentSkip to conversation

nios2: Use str_yes_no() helper in show_cpuinfo()

PATCH RESEND Applied Thorsten Blum 2 participants 2 messages Dec 9, 2024 – Dec 17, 2024 NIOS2 architecture

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 nios2: Use str_yes_no() helper in show_cpuinfo()

Remove hard-coded strings by using the str_yes_no() helper function.

---
 arch/nios2/kernel/cpuinfo.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/nios2/kernel/cpuinfo.c +5 -5
index 338849c430a5..7b1e8f9128e9 100644
@@ -143,11 +143,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 		   " DIV:\t\t%s\n"
 		   " BMX:\t\t%s\n"
 		   " CDX:\t\t%s\n",
-		   cpuinfo.has_mul ? "yes" : "no",
-		   cpuinfo.has_mulx ? "yes" : "no",
-		   cpuinfo.has_div ? "yes" : "no",
-		   cpuinfo.has_bmx ? "yes" : "no",
-		   cpuinfo.has_cdx ? "yes" : "no");
+		   str_yes_no(cpuinfo.has_mul),
+		   str_yes_no(cpuinfo.has_mulx),
+		   str_yes_no(cpuinfo.has_div),
+		   str_yes_no(cpuinfo.has_bmx),
+		   str_yes_no(cpuinfo.has_cdx));
 
 	seq_printf(m,
 		   "Icache:\t\t%ukB, line length: %u\n",
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 18 lines · Thorsten Blum

Remove hard-coded strings by using the str_yes_no() helper function.

---
  arch/nios2/kernel/cpuinfo.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
arch/nios2/kernel/cpuinfo.c +0 -3
index 338849c430a5..7b1e8f9128e9 100644
@@ -143,11 +143,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
  		   " DIV:\t\t%s\n"
  		   " BMX:\t\t%s\n"
  		   " CDX:\t\t%s\n",
-		   cpuinfo.has_mul ? "yes" : "no",
-		   cpuinfo.has_mulx ? "yes" : "no",
-		   cpuinfo.has_div ? "yes" : "no",

arch/nios2/kernel/cpuinfo.c static int show_cpuinfo(struct seq_file *m, void *v) · line 153

Quoted 10 lines
arch/nios2/kernel/cpuinfo.c +5 -2
-		   cpuinfo.has_bmx ? "yes" : "no",
-		   cpuinfo.has_cdx ? "yes" : "no");
+		   str_yes_no(cpuinfo.has_mul),
+		   str_yes_no(cpuinfo.has_mulx),
+		   str_yes_no(cpuinfo.has_div),
+		   str_yes_no(cpuinfo.has_bmx),
+		   str_yes_no(cpuinfo.has_cdx));
 
  	seq_printf(m,
  		   "Icache:\t\t%ukB, line length: %u\n",

Applied!

Thanks,
Dinh