summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/bugs.h
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@mips.com>2019-10-01 23:04:32 +0000
committerPaul Burton <paul.burton@mips.com>2019-10-07 09:38:53 -0700
commit071d2f0b5419d3cf80cc8ba73ec8fe2cedc4cc0c (patch)
treefbeb42baaa31a9f5c6eb2869313c2e22f9c1fa85 /arch/mips/include/asm/bugs.h
parent4bf841ebf17aaa0f7712623896c699b44fa92f44 (diff)
MIPS: r4k-bugs64: Limit R4k bug checks to affected systems
Only build the checks for R4k errata workarounds if we expect that the kernel might actually run on a system with an R4k CPU - ie. CONFIG_SYS_HAS_CPU_R4X00=y & we're targeting a pre-MIPSr1 ISA revision. Rename cpu-bugs64.c to r4k-bugs64.c to indicate the fact that the code is specific to R4k CPUs. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
Diffstat (limited to 'arch/mips/include/asm/bugs.h')
-rw-r--r--arch/mips/include/asm/bugs.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/mips/include/asm/bugs.h b/arch/mips/include/asm/bugs.h
index d8ab8b7129b5..d72dc6e1cf3c 100644
--- a/arch/mips/include/asm/bugs.h
+++ b/arch/mips/include/asm/bugs.h
@@ -26,9 +26,8 @@ extern void check_bugs64(void);
static inline void check_bugs_early(void)
{
-#ifdef CONFIG_64BIT
- check_bugs64_early();
-#endif
+ if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+ check_bugs64_early();
}
static inline void check_bugs(void)
@@ -37,19 +36,18 @@ static inline void check_bugs(void)
cpu_data[cpu].udelay_val = loops_per_jiffy;
check_bugs32();
-#ifdef CONFIG_64BIT
- check_bugs64();
-#endif
+
+ if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+ check_bugs64();
}
static inline int r4k_daddiu_bug(void)
{
-#ifdef CONFIG_64BIT
+ if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+ return 0;
+
WARN_ON(daddiu_bug < 0);
return daddiu_bug != 0;
-#else
- return 0;
-#endif
}
#endif /* _ASM_BUGS_H */