Skip to content

Commit

Permalink
powerpc/kernel: Convert cpu_has_feature() to returning bool
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman committed Aug 1, 2016
1 parent a81dc9d commit 6574ba9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6574ba9

Please sign in to comment.