From 52070c709dbc493da550086709934e6028457a7c Mon Sep 17 00:00:00 2001 From: Sebastian Wankerl Date: Sun, 20 Jan 2013 16:24:45 +0100 Subject: wlan-ng/prism2mgmt.c: added parantheses to macro Enclose the macro into braces so that it can be closed by a semicolon Signed-off-by: Sebastian Wankerl Signed-off-by: Sebastian Ehrenfels Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mgmt.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'drivers/staging/wlan-ng') 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); -- cgit v1.1 From 25c97da8b975d8717a0242c651896b56b2696060 Mon Sep 17 00:00:00 2001 From: Sebastian Wankerl Date: Sun, 20 Jan 2013 16:30:54 +0100 Subject: wlan-ng/prism2mgmt.c: formated too long lines Formated pr_debug() calls Signed-off-by: Sebastian Wankerl Signed-off-by: Sebastian Ehrenfels Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mgmt.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 62b94b0..fba4af80 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -1144,9 +1144,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) /* Enable the port */ result = hfa384x_drvr_enable(hw, 0); if (result) { - pr_debug - ("failed to enable port to presniff setting, result=%d\n", - result); + pr_debug("failed to enable port to presniff setting, result=%d\n", + result); goto failed; } } else { @@ -1186,18 +1185,16 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) hfa384x_drvr_stop(hw); result = hfa384x_drvr_start(hw); if (result) { - pr_debug - ("failed to restart the card for sniffing, result=%d\n", - result); + pr_debug("failed to restart the card for sniffing, result=%d\n", + result); goto failed; } } else { /* Disable the port */ result = hfa384x_drvr_disable(hw, 0); if (result) { - pr_debug - ("failed to enable port for sniffing, result=%d\n", - result); + pr_debug("failed to enable port for sniffing, result=%d\n", + result); goto failed; } } -- cgit v1.1 From eec0d0dc4e16c0c412db337acc36f95411ef946e Mon Sep 17 00:00:00 2001 From: Garrick He Date: Fri, 1 Feb 2013 01:45:16 -0800 Subject: Staging: wlan-ng: Fix tab coding style issue in hfa384x.h Fix all 'please, no space before tabs' warning found by checkpatch.pl Signed-off-by: Garrick He Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 5631ad0..04c0433 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -81,8 +81,8 @@ #define HFA384x_WEPFLAGS_EXCLUDE ((u16)BIT(1)) #define HFA384x_WEPFLAGS_DISABLE_TXCRYPT ((u16)BIT(4)) #define HFA384x_WEPFLAGS_DISABLE_RXCRYPT ((u16)BIT(7)) -#define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3) -#define HFA384x_PORTSTATUS_DISABLED ((u16)1) +#define HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM ((u16)3) +#define HFA384x_PORTSTATUS_DISABLED ((u16)1) #define HFA384x_RATEBIT_1 ((u16)1) #define HFA384x_RATEBIT_2 ((u16)2) #define HFA384x_RATEBIT_5dot5 ((u16)4) @@ -164,7 +164,7 @@ #define HFA384x_CMDCODE_DOWNLD ((u16)0x22) /*--- Debugging Commands -----------------------------*/ -#define HFA384x_CMDCODE_MONITOR ((u16)(0x38)) +#define HFA384x_CMDCODE_MONITOR ((u16)(0x38)) #define HFA384x_MONITOR_ENABLE ((u16)(0x0b)) #define HFA384x_MONITOR_DISABLE ((u16)(0x0f)) @@ -275,15 +275,15 @@ API ENHANCEMENTS (NOT ALREADY IMPLEMENTED) #define HFA384x_RID_CNFAUTHENTICATION ((u16)0xFC2A) #define HFA384x_RID_CNFROAMINGMODE ((u16)0xFC2D) #define HFA384x_RID_CNFAPBCNint ((u16)0xFC33) -#define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46) -#define HFA384x_RID_CNFWPADATA ((u16)0xFC48) +#define HFA384x_RID_CNFDBMADJUST ((u16)0xFC46) +#define HFA384x_RID_CNFWPADATA ((u16)0xFC48) #define HFA384x_RID_CNFBASICRATES ((u16)0xFCB3) #define HFA384x_RID_CNFSUPPRATES ((u16)0xFCB4) #define HFA384x_RID_CNFPASSIVESCANCTRL ((u16)0xFCBA) -#define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE) +#define HFA384x_RID_TXPOWERMAX ((u16)0xFCBE) #define HFA384x_RID_JOINREQUEST ((u16)0xFCE2) #define HFA384x_RID_AUTHENTICATESTA ((u16)0xFCE3) -#define HFA384x_RID_HOSTSCAN ((u16)0xFCE5) +#define HFA384x_RID_HOSTSCAN ((u16)0xFCE5) #define HFA384x_RID_CNFWEPDEFAULTKEY_LEN ((u16)6) #define HFA384x_RID_CNFWEP128DEFAULTKEY_LEN ((u16)14) @@ -311,7 +311,7 @@ PD Record codes #define HFA384x_PDR_HFA3861_IFRF ((u16)0x0204) #define HFA384x_PDR_HFA3861_CHCALSP ((u16)0x0300) #define HFA384x_PDR_HFA3861_CHCALI ((u16)0x0301) -#define HFA384x_PDR_MAX_TX_POWER ((u16)0x0302) +#define HFA384x_PDR_MAX_TX_POWER ((u16)0x0302) #define HFA384x_PDR_MASTER_CHAN_LIST ((u16)0x0303) #define HFA384x_PDR_3842_NIC_CONFIG ((u16)0x0400) #define HFA384x_PDR_USB_ID ((u16)0x0401) @@ -322,10 +322,10 @@ PD Record codes #define HFA384x_PDR_USB_POWER_TYPE ((u16)0x0407) #define HFA384x_PDR_USB_MAX_POWER ((u16)0x0409) #define HFA384x_PDR_USB_MANUFACTURER ((u16)0x0410) -#define HFA384x_PDR_USB_PRODUCT ((u16)0x0411) -#define HFA384x_PDR_ANT_DIVERSITY ((u16)0x0412) -#define HFA384x_PDR_HFO_DELAY ((u16)0x0413) -#define HFA384x_PDR_SCALE_THRESH ((u16)0x0414) +#define HFA384x_PDR_USB_PRODUCT ((u16)0x0411) +#define HFA384x_PDR_ANT_DIVERSITY ((u16)0x0412) +#define HFA384x_PDR_HFO_DELAY ((u16)0x0413) +#define HFA384x_PDR_SCALE_THRESH ((u16)0x0414) #define HFA384x_PDR_HFA3861_MANF_TESTSP ((u16)0x0900) #define HFA384x_PDR_HFA3861_MANF_TESTI ((u16)0x0901) @@ -383,7 +383,7 @@ typedef struct hfa384x_caplevel { /*-- Configuration Record: cnfAuthentication --*/ #define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001 #define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002 -#define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 +#define HFA384x_CNFAUTHENTICATION_LEAP 0x0004 /*-------------------------------------------------------------------- Configuration Record Structures: @@ -575,8 +575,8 @@ Information Types #define HFA384x_IT_AUTHREQ ((u16)0xF202UL) #define HFA384x_IT_PSUSERCNT ((u16)0xF203UL) #define HFA384x_IT_KEYIDCHANGED ((u16)0xF204UL) -#define HFA384x_IT_ASSOCREQ ((u16)0xF205UL) -#define HFA384x_IT_MICFAILURE ((u16)0xF206UL) +#define HFA384x_IT_ASSOCREQ ((u16)0xF205UL) +#define HFA384x_IT_MICFAILURE ((u16)0xF206UL) /*-------------------------------------------------------------------- Information Frames Structures -- cgit v1.1 From fae7e4d39373305cf505d1f0871a4491897d56f9 Mon Sep 17 00:00:00 2001 From: Peter Huewe Date: Thu, 14 Feb 2013 03:37:10 +0100 Subject: staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c clang/scan-build complains that: p80211netdev.c:451:6: warning: Branch condition evaluates to a garbage value if ((p80211_wep.data) && (p80211_wep.data != skb->data)) ^~~~~~~~~~~~~~~~~ This can happen in p80211knetdev_hard_start_xmit if - if (wlandev->state != WLAN_DEVICE_OPEN) evaluates to true. the execution flow then continues at the 'failed' label where p80211_wep.data is used without being initialized first. -> Initialize the data field to NULL to fix this issue. Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211netdev.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 750330f..0039e08 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -351,6 +351,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, union p80211_hdr p80211_hdr; struct p80211_metawep p80211_wep; + p80211_wep.data = NULL; + if (skb == NULL) return NETDEV_TX_OK; -- cgit v1.1 From 2e38027588479421d244266f6edc0b4945546271 Mon Sep 17 00:00:00 2001 From: Kumar Amit Mehta Date: Sat, 16 Feb 2013 05:01:22 -0800 Subject: staging: wlan-ng: hfa384x.h: fix for error reported by smatch Add the missing header include for 'struct urb' datatypes to avoid potential build issues. Found using smatch. Signed-off-by: Kumar Amit Mehta Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 04c0433..3dfa85c 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -59,6 +59,7 @@ #define HFA384x_FIRMWARE_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) #include +#include /*--- Mins & Maxs -----------------------------------*/ #define HFA384x_PORTID_MAX ((u16)7) -- cgit v1.1