From 168400d0e93e5d08c16bec538335ab1c906a43a3 Mon Sep 17 00:00:00 2001 From: Markus Buettner Date: Mon, 9 Jan 2017 17:43:31 +0100 Subject: staging: wlan-ng: remove unnecessary blank lines checkpatch.pl complained about two unnecessary blank lines after an opening '{' in prism2mib.c. Those were removed in order to get rid of those warnings. There are more issues pointed out by checkpatch.pl. Those require additional work to be done. Signed-off-by: Markus Buettner Signed-off-by: Artur Wasinger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mib.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index 8ea6a647d037..4c3d394f3e33 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -146,7 +146,6 @@ static int prism2mib_priv(struct mibrec *mib, struct p80211msg_dot11req_mibset *msg, void *data); static struct mibrec mibtab[] = { - /* dot11smt MIB's */ {DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(1), F_STA | F_WRITE, @@ -624,7 +623,6 @@ static int prism2mib_excludeunencrypted(struct mibrec *mib, struct p80211msg_dot11req_mibset *msg, void *data) { - return prism2mib_flag(mib, isget, wlandev, hw, msg, data); } -- cgit v1.2.3 From e996024f04638dc505f2c4f532af69ff5e8feced Mon Sep 17 00:00:00 2001 From: Eric Salem Date: Tue, 10 Jan 2017 22:48:51 -0600 Subject: staging: wlan-ng: Fix sparse warnings about endianness Fixed sparse warnings about endianness. E.g.: warning: cast to restricted __le16 Signed-off-by: Eric Salem Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 60caf9c37727..5f1851c85f12 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -1388,13 +1388,13 @@ static inline int hfa384x_drvr_getconfig16(struct hfa384x *hw, u16 rid, void *va result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); if (result == 0) - *((u16 *)val) = le16_to_cpu(*((u16 *)val)); + le16_to_cpus(val); return result; } static inline int hfa384x_drvr_setconfig16(struct hfa384x *hw, u16 rid, u16 val) { - u16 value = cpu_to_le16(val); + __le16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } -- cgit v1.2.3 From 045cb1c7b8adfc7ca369c5c66bf961c2c7f80f34 Mon Sep 17 00:00:00 2001 From: Scott Matheina Date: Wed, 11 Jan 2017 21:38:32 -0600 Subject: staging:wlan-ng:cfg80211.c Aligned code with open parenthesis Fixed Alignment should match open parenthesis checkpatch CHECK. Signed-off-by: Scott Matheina Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/cfg80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index aa0e5a3d4a89..11870cb3f254 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -483,8 +483,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, msg_join.authtype.data = P80211ENUM_authalg_sharedkey; else netdev_warn(dev, - "Unhandled authorisation type for connect (%d)\n", - sme->auth_type); + "Unhandled authorisation type for connect (%d)\n", + sme->auth_type); /* Set the encryption - we only support wep */ if (is_wep) { @@ -667,7 +667,7 @@ void prism2_disconnected(struct wlandevice *wlandev) void prism2_roamed(struct wlandevice *wlandev) { cfg80211_roamed(wlandev->netdev, NULL, wlandev->bssid, - NULL, 0, NULL, 0, GFP_KERNEL); + NULL, 0, NULL, 0, GFP_KERNEL); } /* Structures for declaring wiphy interface */ -- cgit v1.2.3 From 2c474b8579e9b67ff72b2bcefce9f53c7f4469d4 Mon Sep 17 00:00:00 2001 From: Igor Pylypiv Date: Mon, 30 Jan 2017 21:39:54 -0800 Subject: staging: wlan-ng: add missing byte order conversion Conversion macros le16_to_cpu was removed and that caused new sparse warning sparse output: drivers/staging/wlan-ng/p80211netdev.c:241:44: warning: incorrect type in argument 2 (different base types) drivers/staging/wlan-ng/p80211netdev.c:241:44: expected unsigned short [unsigned] [usertype] fc drivers/staging/wlan-ng/p80211netdev.c:241:44: got restricted __le16 [usertype] fc Fixes: 7ad82572348c ("staging:wlan-ng:Fix sparse warning") Signed-off-by: Igor Pylypiv Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 73fcf07254fe..eea50b614638 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -237,7 +237,7 @@ static int p80211_convert_to_ether(struct wlandevice *wlandev, struct p80211_hdr_a3 *hdr; hdr = (struct p80211_hdr_a3 *)skb->data; - if (p80211_rx_typedrop(wlandev, hdr->fc)) + if (p80211_rx_typedrop(wlandev, le16_to_cpu(hdr->fc))) return CONV_TO_ETHER_SKIPPED; /* perform mcast filtering: allow my local address through but reject -- cgit v1.2.3 From 55dd5a39a982dad9a39fe48a1c0066f46a8a0ba0 Mon Sep 17 00:00:00 2001 From: Frans Klaver Date: Thu, 9 Feb 2017 22:58:21 +0100 Subject: staging: wlan_ng: fix logical continuation alignment It appears that our coding style prefers that logical continuations have the operator at the end of the line. Fix that. While at it, stick the 'if' after 'else' where it belongs. Signed-off-by: Frans Klaver Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mgmt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index c558ad656c49..0e671c3b308d 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -1303,14 +1303,13 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp) /* Set the driver state */ /* Do we want the prism2 header? */ if ((msg->prismheader.status == - P80211ENUM_msgitem_status_data_ok) - && (msg->prismheader.data == P80211ENUM_truth_true)) { + P80211ENUM_msgitem_status_data_ok) && + (msg->prismheader.data == P80211ENUM_truth_true)) { hw->sniffhdr = 0; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; - } else - if ((msg->wlanheader.status == - P80211ENUM_msgitem_status_data_ok) - && (msg->wlanheader.data == P80211ENUM_truth_true)) { + } else if ((msg->wlanheader.status == + P80211ENUM_msgitem_status_data_ok) && + (msg->wlanheader.data == P80211ENUM_truth_true)) { hw->sniffhdr = 1; wlandev->netdev->type = ARPHRD_IEEE80211_PRISM; } else { -- cgit v1.2.3 From 606ea2bd81d0290dbea2c84c976dee3dd39c3427 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Sat, 11 Feb 2017 11:13:47 +0100 Subject: staging: wlan-ng: reduce type warnings Fixes the following sparse output: drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:154:38: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:154:38: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:154:38: got restricted __be16 [usertype] drivers/staging/wlan-ng/p80211conv.c:390:42: warning: cast to restricted __le16 drivers/staging/wlan-ng/p80211conv.c:413:29: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:413:29: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:413:29: got restricted __be16 [usertype] drivers/staging/wlan-ng/p80211conv.c:481:29: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:481:29: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:481:29: got restricted __be16 [usertype] Signed-off-by: Alexander Alemayhu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211conv.c | 2 +- drivers/staging/wlan-ng/p80211conv.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 8387e6a3031a..8b0905e7c9be 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -387,7 +387,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, (((memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) == 0) && (ethconv == WLAN_ETHCONV_8021h) && - (p80211_stt_findproto(le16_to_cpu(e_snap->type)))) || + (p80211_stt_findproto(be16_to_cpu(e_snap->type)))) || (memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) != 0))) { pr_debug("SNAP+RFC1042 len: %d\n", payload_length); diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h index ed70d98e5cf1..04bac2ed0e8a 100644 --- a/drivers/staging/wlan-ng/p80211conv.h +++ b/drivers/staging/wlan-ng/p80211conv.h @@ -130,7 +130,7 @@ struct p80211_metawep { struct wlan_ethhdr { u8 daddr[ETH_ALEN]; u8 saddr[ETH_ALEN]; - u16 type; + __be16 type; } __packed; /* local llc header type */ @@ -143,7 +143,7 @@ struct wlan_llc { /* local snap header type */ struct wlan_snap { u8 oui[WLAN_IEEE_OUI_LEN]; - u16 type; + __be16 type; } __packed; /* Circular include trick */ -- cgit v1.2.3 From f3fe2a8e60d27ea0c2410ff299efb58fc2032b93 Mon Sep 17 00:00:00 2001 From: Gargi Sharma Date: Thu, 16 Feb 2017 22:58:35 +0530 Subject: staging: wlan-ng: remove space before tab remove the space before the tab to fix the the checkpatch issue, no spaces before tabs. Signed-off-by: Gargi Sharma Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/prism2mib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlan-ng') diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index 4c3d394f3e33..28df1f3d6f4a 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -745,7 +745,7 @@ static int prism2mib_priv(struct mibrec *mib, * pstr wlan message data * * Returns: - * Nothing + * Nothing * */ -- cgit v1.2.3