MIPS: adding a safety check for cpu_has_fpu
PATCH v4 1/1 MIPS: adding a safety check for cpu_has_fpu
From: Shida Zhang <[email protected]>
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'.
---
Changelog in v1 -> v2:
- Choose to redefine cpu_has_fpu to solve the problem silently.
Changelog in v2 -> v3:
- Choose to point out the error instead.
Changelog in v3 -> v4:
- Make the check work for 'nofpu' option.
arch/mips/include/asm/cpu-features.h | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/include/asm/cpu-features.h +3 -0
@@ -133,6 +133,9 @@# 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
Signature · 1 line
2.30.2
Quoted 37 lines · Stephen Zhang
From: Shida Zhang <[email protected]>
There is a chance '
cpu_has_fpu' would still be overridden when theCONFIG_MIPS_FP_SUPPORTconfiguration option has been disabled. So add a safety check for 'cpu_has_fpu'.Suggested-by Maciej W. Rozycki <[email protected]>Signed-off-by Shida Zhang <[email protected]>---
Changelog in v1 -> v2:
- Choose to redefinecpu_has_fputo solve the problem silently.Changelog in v2 -> v3:
- Choose to point out the error instead.Changelog in v3 -> v4:
- Make the check work for 'nofpu' option.arch/mips/include/asm/cpu-features.h | 3 +++ 1 file changed, 3 insertions(+)arch/mips/include/asm/cpu-features.h +3
-0@@ -133,6 +133,9 @@# 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_32fprSignature · 1 line
2.30.2
applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]