Skip to content

Commit 03a99d1

Browse files
Avenger-285714chenhuacai
authored andcommitted
LoongArch: Use str_yes_no() helper function for /proc/cpuinfo
Remove hard-coded strings by using the str_yes_no() helper function. Similar to commit c4a0a4a ("MIPS: kernel: proc: Use str_yes_no() helper function"). Co-developed-by: Wentao Guan <[email protected]> Signed-off-by: Wentao Guan <[email protected]> Signed-off-by: Yuli Wang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 619b527 commit 03a99d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/loongarch/kernel/proc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
9191
if (cpu_has_lbt_mips) seq_printf(m, " lbt_mips");
9292
seq_printf(m, "\n");
9393

94-
seq_printf(m, "Hardware Watchpoint\t: %s",
95-
cpu_has_watch ? "yes, " : "no\n");
94+
seq_printf(m, "Hardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
9695
if (cpu_has_watch) {
97-
seq_printf(m, "iwatch count: %d, dwatch count: %d\n",
96+
seq_printf(m, ", iwatch count: %d, dwatch count: %d",
9897
cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
9998
}
10099

@@ -104,7 +103,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
104103
raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
105104
&proc_cpuinfo_notifier_args);
106105

107-
seq_printf(m, "\n");
106+
seq_printf(m, "\n\n");
108107

109108
return 0;
110109
}

0 commit comments

Comments
 (0)