Search Linux Wireless

[PATCH] mac80211: fix ecw2cw brain-damage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This brain-damaged code just bothers me, fix it.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
---
 net/mac80211/ieee80211_sta.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- everything.orig/net/mac80211/ieee80211_sta.c	2008-02-14 00:23:04.447865289 +0100
+++ everything/net/mac80211/ieee80211_sta.c	2008-02-14 00:24:11.977817546 +0100
@@ -227,12 +227,7 @@ static void ieee802_11_parse_elems(u8 *s
 
 static int ecw2cw(int ecw)
 {
-	int cw = 1;
-	while (ecw > 0) {
-		cw <<= 1;
-		ecw--;
-	}
-	return cw - 1;
+	return (1 << ecw) - 1;
 }
 
 static void ieee80211_sta_wmm_params(struct net_device *dev,


-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux