diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 11f2ee6b2269f1ac22c34600e82b5277edf2bea8..a465e38c72529e778728542afdc7caac9cde0282 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,