Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix ecw2cw brain-damage
@ 2008-02-13 23:30 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2008-02-13 23:30 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

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

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 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,



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-14 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13 23:30 [PATCH] mac80211: fix ecw2cw brain-damage Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox