diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2016-07-27 13:35:15 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-08-01 11:14:58 +1000 |
commit | 6574ba950bbe9ab2460f8143018d93d15cacf5be (patch) | |
tree | 10d3b2b15dccbc16e2917b1b3913203dc444a975 /arch/powerpc/include/asm/cputable.h | |
parent | a81dc9d9957354ee2ebc2e387cbc10cf457b9948 (diff) | |
download | lwn-6574ba950bbe9ab2460f8143018d93d15cacf5be.tar.gz lwn-6574ba950bbe9ab2460f8143018d93d15cacf5be.zip |
powerpc/kernel: Convert cpu_has_feature() to returning bool
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>
Diffstat (limited to 'arch/powerpc/include/asm/cputable.h')
-rw-r--r-- | arch/powerpc/include/asm/cputable.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index df4fb5faba43..7bb87017d9db 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h @@ -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 |