From 8954ef903fa5f86a42580bcf80cb0116ab2b3c02 Mon Sep 17 00:00:00 2001 From: Gargi Sharma Date: Sat, 18 Feb 2017 11:07:41 +0530 Subject: staging: wlan-ng: remove extra parentheses Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script: @@ expression e; identifier f; @@ f(..., -( e -) ,...) Signed-off-by: Gargi Sharma Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 8b0905e7c9be..a062e80361ef 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -211,7 +211,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv, return -ENOMEM; foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, skb->len, - (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK), + wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK, p80211_wep->iv, p80211_wep->icv); if (foo) { netdev_warn(wlandev->netdev, -- cgit v1.2.3 From c519822a8a7d480ecc1b5bb67b80ba73e747c4a4 Mon Sep 17 00:00:00 2001 From: Georgios Emmanouil Date: Thu, 16 Feb 2017 22:13:32 +0200 Subject: Staging: wlan-ng: prism2mgmt: Removed an empty line Removed an empty line. Signed-off-by: Georgios Emmanouil Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mgmt.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 0e671c3b308d..e23a0d0e7b09 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -1168,7 +1168,6 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) } } else { result = hfa384x_drvr_disable(hw, 0); - } netdev_info(wlandev->netdev, "monitor mode disabled\n"); -- cgit v1.2.3 From 766ceda083dabc0d112939bbdc1f26abc409483d Mon Sep 17 00:00:00 2001 From: simran singhal Date: Fri, 3 Mar 2017 21:29:04 +0530 Subject: staging: wlan-ng: Replace "the the " with "the" This patch replace "the the " with "the". The replacement couldn't be automated because sometimes the first "the" was meant to be another word. Signed-off-by: simran singhal Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 984804b92e05..9c2b4ef2de58 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -1311,7 +1311,7 @@ void prism2sta_processing_defer(struct work_struct *data) /* This one indicates that the MAC has decided to and * successfully completed a change to another AP. We * should probably implement a reassociation indication - * in response to this one. I'm thinking that the the + * in response to this one. I'm thinking that the * p80211 layer needs to be notified in case of * buffering/queueing issues. User mode also needs to be * notified so that any BSS dependent elements can be -- cgit v1.2.3 From ecf2d4aa7abe3128bf3f49d7b21f269c8a937cf2 Mon Sep 17 00:00:00 2001 From: Aapo Vienamo Date: Tue, 7 Mar 2017 13:52:47 +0200 Subject: staging: wlan-ng: add byte order annotation to struct p80211_caphdr Fixes the following sparse warnings around line 3514 in hfa384x_usb.c: warning: incorrect type in assignment (different base types) expected unsigned int [unsigned] [usertype] version got restricted __be32 [usertype] Signed-off-by: Aapo Vienamo Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211conv.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h index 04bac2ed0e8a..66332b1fb6d5 100644 --- a/drivers/staging/wlan-ng/p80211conv.h +++ b/drivers/staging/wlan-ng/p80211conv.h @@ -101,20 +101,20 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb); * Frame capture header. (See doc/capturefrm.txt) */ struct p80211_caphdr { - u32 version; - u32 length; - u64 mactime; - u64 hosttime; - u32 phytype; - u32 channel; - u32 datarate; - u32 antenna; - u32 priority; - u32 ssi_type; - s32 ssi_signal; - s32 ssi_noise; - u32 preamble; - u32 encoding; + __be32 version; + __be32 length; + __be64 mactime; + __be64 hosttime; + __be32 phytype; + __be32 channel; + __be32 datarate; + __be32 antenna; + __be32 priority; + __be32 ssi_type; + __be32 ssi_signal; + __be32 ssi_noise; + __be32 preamble; + __be32 encoding; }; /* buffer free method pointer type */ -- cgit v1.2.3 From a18ffdf4ea7c6ac496f940d0852d42e1074c3450 Mon Sep 17 00:00:00 2001 From: Adrien Descamps Date: Thu, 9 Mar 2017 21:15:18 +0100 Subject: Staging: wlan-ng: Fix sparse warnings by using appropriate endian types Fix some sparse warning by using correct endian types in structs and local variables. This patch only fix sparse warnings and do not change the logic. Signed-off-by: Adrien Descamps Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 54 +++++++++++++++++------------------ drivers/staging/wlan-ng/hfa384x_usb.c | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 5f1851c85f12..ba67b7a54358 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -482,7 +482,7 @@ struct hfa384x_tx_frame { u8 address3[6]; u16 sequence_control; u8 address4[6]; - u16 data_len; /* little endian format */ + __le16 data_len; /* little endian format */ /*-- 802.3 Header Information --*/ @@ -801,41 +801,41 @@ struct hfa384x_usb_txfrm { } __packed; struct hfa384x_usb_cmdreq { - u16 type; - u16 cmd; - u16 parm0; - u16 parm1; - u16 parm2; + __le16 type; + __le16 cmd; + __le16 parm0; + __le16 parm1; + __le16 parm2; u8 pad[54]; } __packed; struct hfa384x_usb_wridreq { - u16 type; - u16 frmlen; - u16 rid; + __le16 type; + __le16 frmlen; + __le16 rid; u8 data[HFA384x_RIDDATA_MAXLEN]; } __packed; struct hfa384x_usb_rridreq { - u16 type; - u16 frmlen; - u16 rid; + __le16 type; + __le16 frmlen; + __le16 rid; u8 pad[58]; } __packed; struct hfa384x_usb_wmemreq { - u16 type; - u16 frmlen; - u16 offset; - u16 page; + __le16 type; + __le16 frmlen; + __le16 offset; + __le16 page; u8 data[HFA384x_USB_RWMEM_MAXLEN]; } __packed; struct hfa384x_usb_rmemreq { - u16 type; - u16 frmlen; - u16 offset; - u16 page; + __le16 type; + __le16 frmlen; + __le16 offset; + __le16 page; u8 pad[56]; } __packed; @@ -854,16 +854,16 @@ struct hfa384x_usb_infofrm { struct hfa384x_usb_statusresp { u16 type; - u16 status; - u16 resp0; - u16 resp1; - u16 resp2; + __le16 status; + __le16 resp0; + __le16 resp1; + __le16 resp2; } __packed; struct hfa384x_usb_rridresp { u16 type; - u16 frmlen; - u16 rid; + __le16 frmlen; + __le16 rid; u8 data[HFA384x_RIDDATA_MAXLEN]; } __packed; @@ -1408,7 +1408,7 @@ hfa384x_drvr_setconfig_async(struct hfa384x *hw, static inline int hfa384x_drvr_setconfig16_async(struct hfa384x *hw, u16 rid, u16 val) { - u16 value = cpu_to_le16(val); + __le16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), NULL, NULL); diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 6134eba5cad4..64848778834c 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -2316,7 +2316,7 @@ int hfa384x_drvr_ramdl_write(struct hfa384x *hw, u32 daddr, void *buf, u32 len) int hfa384x_drvr_readpda(struct hfa384x *hw, void *buf, unsigned int len) { int result = 0; - u16 *pda = buf; + __le16 *pda = buf; int pdaok = 0; int morepdrs = 1; int currpdr = 0; /* word offset of the current pdr */ -- cgit v1.2.3 From 68e009ed1cc699a32557705d76877c5209400103 Mon Sep 17 00:00:00 2001 From: Adrien Descamps Date: Thu, 9 Mar 2017 21:15:19 +0100 Subject: Staging: wlan-ng: Fix endian error sparse report fixed: drivers/staging//wlan-ng//hfa384x_usb.c:3517:35: warning: restricted __be64 degrades to integer drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: warning: incorrect type in assignment (different base types) drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: expected restricted __be64 [usertype] mactime drivers/staging//wlan-ng//hfa384x_usb.c:3517:33: got unsigned long long Computation on the value should be done when in machine format, not in big endian format. Signed-off-by: Adrien Descamps Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 64848778834c..a812e55ba1b0 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3513,7 +3513,7 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev, caphdr->version = htonl(P80211CAPTURE_VERSION); caphdr->length = htonl(sizeof(struct p80211_caphdr)); - caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000; + caphdr->mactime = __cpu_to_be64(rxdesc->time * 1000); caphdr->hosttime = __cpu_to_be64(jiffies); caphdr->phytype = htonl(4); /* dss_dot11_b */ caphdr->channel = htonl(hw->sniff_channel); -- cgit v1.2.3 From 76b4580bf4eaf1c7d5a603c0da405e72a89b3927 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sat, 8 Apr 2017 16:04:42 +0200 Subject: staging wlan-ng: fix type mismatch warnings in mkpdrlist() struct hfa384x_pdrec len and code fields as clearly little endian, mark both fields as such. pda->buf is also clearly little endian. Fixes sparse warnings: drivers/staging/wlan-ng/prism2fw.c:613:16: warning: cast to restricted __le16 drivers/staging/wlan-ng/prism2fw.c:616:21: warning: cast to restricted __le16 drivers/staging/wlan-ng/prism2fw.c:625:21: warning: cast to restricted __le16 Signed-off-by: Maciek Borzecki Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 4 ++-- drivers/staging/wlan-ng/prism2fw.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index ba67b7a54358..310e2c454590 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -1078,8 +1078,8 @@ struct hfa384x_pdr_end_of_pda { } __packed; struct hfa384x_pdrec { - u16 len; /* in words */ - u16 code; + __le16 len; /* in words */ + __le16 code; union pdr { struct hfa384x_pdr_pcb_partnum pcb_partnum; struct hfa384x_pdr_pcb_tracenum pcb_tracenum; diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index 2e349f87e738..afd877fb4557 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -604,7 +604,7 @@ static int mkimage(struct imgchunk *clist, unsigned int *ccnt) */ static int mkpdrlist(struct pda *pda) { - u16 *pda16 = (u16 *)pda->buf; + __le16 *pda16 = (__le16 *)pda->buf; int curroff; /* in 'words' */ pda->nrec = 0; -- cgit v1.2.3 From 17475c50bea854ba4e0da8198b98d921be2285cb Mon Sep 17 00:00:00 2001 From: Ian Chard Date: Thu, 27 Apr 2017 09:28:06 +0100 Subject: staging: wlan-ng: break long line in p80211req.c Fix a style warning for a line over 80 characters long. Signed-off-by: Ian Chard Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211req.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index 621df98183bf..afe847722cf7 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -198,7 +198,8 @@ static void p80211req_mibset_mibget(struct wlandevice *wlandev, struct p80211msg_dot11req_mibget *mib_msg, int isget) { - struct p80211itemd *mibitem = (struct p80211itemd *)mib_msg->mibattribute.data; + struct p80211itemd *mibitem = + (struct p80211itemd *)mib_msg->mibattribute.data; struct p80211pstrd *pstr = (struct p80211pstrd *)mibitem->data; u8 *key = mibitem->data + sizeof(struct p80211pstrd); -- cgit v1.2.3