]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/kernel: Convert cpu_has_feature() to returning bool
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 27 Jul 2016 03:35:15 +0000 (13:35 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 1 Aug 2016 01:14:58 +0000 (11:14 +1000)
The intention is that the result is only used as a boolean, so enforce
that by changing the return type to bool.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cputable.h

index df4fb5faba436e1922ef1bd774b0d17ed814b274..7bb87017d9dbdbcc7e7d691e713baf76f3694073 100644 (file)
@@ -2,6 +2,7 @@
 #define __ASM_POWERPC_CPUTABLE_H
 
 
+#include <linux/types.h>
 #include <asm/asm-compat.h>
 #include <asm/feature-fixups.h>
 #include <uapi/asm/cputable.h>
@@ -576,12 +577,10 @@ enum {
 };
 #endif /* __powerpc64__ */
 
-static inline int cpu_has_feature(unsigned long feature)
+static inline bool cpu_has_feature(unsigned long feature)
 {
-       return (CPU_FTRS_ALWAYS & feature) ||
-              (CPU_FTRS_POSSIBLE
-               & cur_cpu_spec->cpu_features
-               & feature);
+       return !!((CPU_FTRS_ALWAYS & feature) ||
+                 (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
 }
 
 #define HBP_NUM 1