OSDN Git Service

staging: wlan-ng: add parentheses to macro argument usage in prism2mgmt.c
authorTim Collier <osdevtc@gmail.com>
Fri, 22 Jun 2018 19:39:34 +0000 (20:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jun 2018 13:12:50 +0000 (22:12 +0900)
Fix two "CHECK: Macro argument 'N' may be better as '(N)' to avoid
precedence issue" messages, reported by checkpatch, by adding
parentheses around the offending macro argument references.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2mgmt.c

index 28e4029..ebfe69b 100644 (file)
@@ -439,7 +439,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 #define REQBASICRATE(N) \
        do { \
-               if ((count >= N) && DOT11_RATE5_ISBASIC_GET( \
+               if ((count >= (N)) && DOT11_RATE5_ISBASIC_GET(  \
                        item->supprates[(N) - 1])) { \
                        req->basicrate ## N .data = item->supprates[(N) - 1]; \
                        req->basicrate ## N .status = \
@@ -458,7 +458,7 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
 
 #define REQSUPPRATE(N) \
        do { \
-               if (count >= N) { \
+               if (count >= (N)) {                                     \
                        req->supprate ## N .data = item->supprates[(N) - 1]; \
                        req->supprate ## N .status = \
                                P80211ENUM_msgitem_status_data_ok; \