airo: Fix integer overflow warning
authorMichael Buesch <mb@bu3sch.de>
Wed, 25 Nov 2009 21:55:11 +0000 (22:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 4 Dec 2009 18:30:40 +0000 (13:30 -0500)
On BigEndian gcc complains:

drivers/net/wireless/airo.c: In function ‘sniffing_mode’:
drivers/net/wireless/airo.c:4809: warning: integer overflow in expression

Fix this by doing the bitwise AND on the host-endian value.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/airo.c

index 4eec87c3be2b5703ff7dd99a10aa1ef8a1f01685..4331d675fcc62d2550d6036ec0672ef2c093e109 100644 (file)
@@ -4806,7 +4806,7 @@ static int airo_config_commit(struct net_device *dev,
 
 static inline int sniffing_mode(struct airo_info *ai)
 {
-       return le16_to_cpu(ai->config.rmode & RXMODE_MASK) >=
+       return (le16_to_cpu(ai->config.rmode) & le16_to_cpu(RXMODE_MASK)) >=
                le16_to_cpu(RXMODE_RFMON);
 }