]> www.infradead.org Git - users/hch/misc.git/commitdiff
MIPS: kernel: proc: Use str_yes_no() helper function
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 5 Nov 2024 17:38:36 +0000 (18:38 +0100)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 12 Nov 2024 14:46:20 +0000 (15:46 +0100)
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>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/proc.c

index 8eba5a1ed664c4340c7d66c12d9e3e83b9099d02..8f0a0001540c7bcd48344146650c0ad2975e2d66 100644 (file)
@@ -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:");