[PATCH 1/3] wlan-ng/prism2mgmt.c: added parenthesis to macro

Sebastian Ehrenfels qi50dube at cip.cs.fau.de
Tue Dec 18 21:47:14 UTC 2012


From: Sebastian Wankerl <sisewank at faui49man10.informatik.uni-erlangen.de>

Here the hopefully fixed version.

Signed-off-by: Sebastian Wankerl <sisewank at cip.cs.fau.de> 
Signed-off-by: Sebastian Ehrenfels <qi50dube at cip.cs.fau.de> 

---
 drivers/staging/wlan-ng/prism2mgmt.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
index 4efa9bc..62b94b0 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -415,11 +415,14 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 			break;
 
 #define REQBASICRATE(N) \
-	if ((count >= N) && DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
-		req->basicrate ## N .data = item->supprates[(N)-1]; \
-		req->basicrate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N &&
+		    DOT11_RATE5_ISBASIC_GET(item->supprates[(N)-1])) { \
+			req->basicrate ## N .data = item->supprates[(N)-1]; \
+			req->basicrate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+		} \
+	} while (0)
 
 	REQBASICRATE(1);
 	REQBASICRATE(2);
@@ -431,11 +434,13 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 	REQBASICRATE(8);
 
 #define REQSUPPRATE(N) \
-	if (count >= N) { \
-		req->supprate ## N .data = item->supprates[(N)-1]; \
-		req->supprate ## N .status = \
-			P80211ENUM_msgitem_status_data_ok; \
-	}
+	do { \
+		if (count >= N) { \
+			req->supprate ## N .data = item->supprates[(N)-1]; \
+			req->supprate ## N .status = \
+				P80211ENUM_msgitem_status_data_ok; \
+	} \
+	} while (0)
 
 	REQSUPPRATE(1);
 	REQSUPPRATE(2);
-- 
1.7.10.4




More information about the devel mailing list