From: Johannes Berg Date: Wed, 13 Feb 2008 23:30:35 +0000 (+0100) Subject: mac80211: fix ecw2cw brain-damage X-Git-Tag: v2.6.26-rc1~1138^2~530^2~71 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ac2bf3242e1a329543be50b5c9df4f0119ee188c;p=linux-2.6-omap-h63xx.git mac80211: fix ecw2cw brain-damage This brain-damaged code just bothers me, fix it. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 11f2ee6b226..a465e38c725 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -227,12 +227,7 @@ static void ieee802_11_parse_elems(u8 *start, size_t len, 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,