Skip to content

Commit

Permalink
[PATCH] powerpc: Change firmware_has_feature() to a macro
Browse files Browse the repository at this point in the history
So that we can use firmware_has_feature() in a BUG_ON() and have the compiler
elide the code entirely if the feature can never be set, change
firmware_has_feature to a macro. Unfortunate, but necessary at least until
GCC bug #26724 is fixed.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Mar 27, 2006
1 parent e3f94b8 commit dd4d7bf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/asm-powerpc/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ enum {
*/
extern unsigned long ppc64_firmware_features;

static inline unsigned long firmware_has_feature(unsigned long feature)
{
return (FW_FEATURE_ALWAYS & feature) ||
(FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature);
}
#define firmware_has_feature(feature) \
((FW_FEATURE_ALWAYS & (feature)) || \
(FW_FEATURE_POSSIBLE & ppc64_firmware_features & (feature)))

extern void system_reset_fwnmi(void);
extern void machine_check_fwnmi(void);
Expand Down

0 comments on commit dd4d7bf

Please sign in to comment.