Skip to contentSkip to conversation

mac80211: fix ecw2cw brain-damage

PATCH New Johannes Berg 1 participant 1 message Feb 14, 2008 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix ecw2cw brain-damage

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

---
 net/mac80211/ieee80211_sta.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
net/mac80211/ieee80211_sta.c +1 -6
@@ -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,