[PATCH 017/119] staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error

Franky Lin frankyl at broadcom.com
Wed Jun 29 23:46:41 UTC 2011


From: Arend van Spriel <arend at broadcom.com>

The macro FOREACH_BSS did an assignment inside the if condition. The
macro has been modified to get rid of the error.

Signed-off-by: Arend van Spriel <arend at broadcom.com>
Reviewed-by: Roland Vossen <rvossen at broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index f7ebaf1..9aa74df 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -254,8 +254,9 @@ const u8 wlc_prio2prec_map[] = {
 
 /* As above for all non-NULL BSS configs */
 #define FOREACH_BSS(wlc, idx, cfg) \
-	for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
-		if ((cfg = (wlc)->bsscfg[idx]))
+	for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
+	     idx < WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
+		if (cfg)
 
 /* Sanity check for tx_prec_map and fifo synchup
  * Either there are some packets pending for the fifo, else if fifo is empty then
-- 
1.7.1





More information about the devel mailing list