Commit dd4d7bfa authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] powerpc: Change firmware_has_feature() to a macro

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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e3f94b85
...@@ -84,11 +84,9 @@ enum { ...@@ -84,11 +84,9 @@ enum {
*/ */
extern unsigned long ppc64_firmware_features; extern unsigned long ppc64_firmware_features;
static inline unsigned long firmware_has_feature(unsigned long feature) #define firmware_has_feature(feature) \
{ ((FW_FEATURE_ALWAYS & (feature)) || \
return (FW_FEATURE_ALWAYS & feature) || (FW_FEATURE_POSSIBLE & ppc64_firmware_features & (feature)))
(FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature);
}
extern void system_reset_fwnmi(void); extern void system_reset_fwnmi(void);
extern void machine_check_fwnmi(void); extern void machine_check_fwnmi(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment