aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00reg.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00reg.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index 6d5acf99a1c5..c2fba7c9f05c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -153,7 +153,7 @@ struct rt2x00_field32 {
153 */ 153 */
154#define is_power_of_two(x) ( !((x) & ((x)-1)) ) 154#define is_power_of_two(x) ( !((x) & ((x)-1)) )
155#define low_bit_mask(x) ( ((x)-1) & ~(x) ) 155#define low_bit_mask(x) ( ((x)-1) & ~(x) )
156#define is_valid_mask(x) is_power_of_two(1 + (x) + low_bit_mask(x)) 156#define is_valid_mask(x) is_power_of_two(1LU + (x) + low_bit_mask(x))
157 157
158/* 158/*
159 * Macro's to find first set bit in a variable. 159 * Macro's to find first set bit in a variable.
@@ -190,8 +190,7 @@ struct rt2x00_field32 {
190 * does not exceed the given typelimit. 190 * does not exceed the given typelimit.
191 */ 191 */
192#define FIELD_CHECK(__mask, __type) \ 192#define FIELD_CHECK(__mask, __type) \
193 BUILD_BUG_ON(!__builtin_constant_p(__mask) || \ 193 BUILD_BUG_ON(!(__mask) || \
194 !(__mask) || \
195 !is_valid_mask(__mask) || \ 194 !is_valid_mask(__mask) || \
196 (__mask) != (__type)(__mask)) \ 195 (__mask) != (__type)(__mask)) \
197 196