Skip to content

Commit 02bba94

Browse files
tobluxtsbogend
authored andcommitted
MIPS: traps: Use str_enabled_disabled() in parity_protection_init()
Remove hard-coded strings by using the str_enabled_disabled() helper function. Use pr_info() instead of printk(KERN_INFO) to silence multiple checkpatch warnings. Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent ddd068d commit 02bba94

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

arch/mips/kernel/traps.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <linux/kdb.h>
3939
#include <linux/irq.h>
4040
#include <linux/perf_event.h>
41+
#include <linux/string_choices.h>
4142

4243
#include <asm/addrspace.h>
4344
#include <asm/bootinfo.h>
@@ -1741,8 +1742,8 @@ static inline __init void parity_protection_init(void)
17411742
gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN;
17421743
WARN_ON(!!gcr_ectl != l2parity);
17431744

1744-
pr_info("Cache parity protection %sabled\n",
1745-
l1parity ? "en" : "dis");
1745+
pr_info("Cache parity protection %s\n",
1746+
str_enabled_disabled(l1parity));
17461747
return;
17471748
}
17481749

@@ -1797,14 +1798,14 @@ static inline __init void parity_protection_init(void)
17971798
printk(KERN_INFO "Readback ErrCtl register=%08lx\n", errctl);
17981799

17991800
if (l1parity_present)
1800-
printk(KERN_INFO "Cache parity protection %sabled\n",
1801-
(errctl & ERRCTL_PE) ? "en" : "dis");
1801+
pr_info("Cache parity protection %s\n",
1802+
str_enabled_disabled(errctl & ERRCTL_PE));
18021803

18031804
if (l2parity_present) {
18041805
if (l1parity_present && l1parity)
18051806
errctl ^= ERRCTL_L2P;
1806-
printk(KERN_INFO "L2 cache parity protection %sabled\n",
1807-
(errctl & ERRCTL_L2P) ? "en" : "dis");
1807+
pr_info("L2 cache parity protection %s\n",
1808+
str_enabled_disabled(errctl & ERRCTL_L2P));
18081809
}
18091810
}
18101811
break;
@@ -1815,8 +1816,8 @@ static inline __init void parity_protection_init(void)
18151816
write_c0_errctl(0x80000000);
18161817
back_to_back_c0_hazard();
18171818
/* Set the PE bit (bit 31) in the c0_errctl register. */
1818-
printk(KERN_INFO "Cache parity protection %sabled\n",
1819-
(read_c0_errctl() & 0x80000000) ? "en" : "dis");
1819+
pr_info("Cache parity protection %s\n",
1820+
str_enabled_disabled(read_c0_errctl() & 0x80000000));
18201821
break;
18211822
case CPU_20KC:
18221823
case CPU_25KF:

0 commit comments

Comments
 (0)