]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
LoongArch: Use str_yes_no() helper function for /proc/cpuinfo
authorYuli Wang <wangyuli@uniontech.com>
Thu, 13 Feb 2025 04:02:35 +0000 (12:02 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 13 Feb 2025 04:02:35 +0000 (12:02 +0800)
Remove hard-coded strings by using the str_yes_no() helper function.

Similar to commit c4a0a4a45a45 ("MIPS: kernel: proc: Use str_yes_no()
helper function").

Co-developed-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Yuli Wang <wangyuli@uniontech.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/proc.c

index 6ce46d92f1f19df8e881e425217217de499c8043..56a230238c9cfdb6c449414e3075a5a3cb26a8e4 100644 (file)
@@ -91,10 +91,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        if (cpu_has_lbt_mips)   seq_printf(m, " lbt_mips");
        seq_printf(m, "\n");
 
-       seq_printf(m, "Hardware Watchpoint\t: %s",
-                     cpu_has_watch ? "yes, " : "no\n");
+       seq_printf(m, "Hardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
        if (cpu_has_watch) {
-               seq_printf(m, "iwatch count: %d, dwatch count: %d\n",
+               seq_printf(m, ", iwatch count: %d, dwatch count: %d",
                      cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
        }
 
@@ -104,7 +103,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
                                &proc_cpuinfo_notifier_args);
 
-       seq_printf(m, "\n");
+       seq_printf(m, "\n\n");
 
        return 0;
 }