MIPS: adding a safety check for cpu_has_fpu
authorShida Zhang <zhangshida@kylinos.cn>
Mon, 2 May 2022 03:20:02 +0000 (11:20 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 4 May 2022 20:26:02 +0000 (22:26 +0200)
There is a chance 'cpu_has_fpu' would still be overridden when the
CONFIG_MIPS_FP_SUPPORT configuration option has been disabled. So
add a safety check for 'cpu_has_fpu'.

Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/cpu-features.h

index de8cb2c..c098313 100644 (file)
 #  define raw_cpu_has_fpu      0
 # endif
 #else
+# if cpu_has_fpu
+#  error "Forcing `cpu_has_fpu' to non-zero is not supported"
+# endif
 # define raw_cpu_has_fpu       cpu_has_fpu
 #endif
 #ifndef cpu_has_32fpr