Skip to contentSkip to conversation

staging: wlang-ng: fix some style warnings in p80211netdev.h

PATCH New Sergio Paracuellos 1 participant 4 messages Sep 27, 2016 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: wlang-ng: fix some style warnings in p80211netdev.h

This patchset fix all remaining warnings reported by checkpatch.pl script for p80211netdev.h header file:
- WARNING: do not add new typedefs
- WARNING: line over 80 characters

Sergio Paracuellos (3):
staging: wlan-ng: avoid new typedef: netdevice_t
staging: wlan-ng: avoid new typedef: p80211_frmrx_t
staging: wlan-ng: fix line style warnings in p80211netdev.h

 drivers/staging/wlan-ng/p80211conv.c   |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c | 38 +++++++++++++++++-----------------
 drivers/staging/wlan-ng/p80211netdev.h | 19 +++++++----------
 drivers/staging/wlan-ng/prism2sta.c    |  6 ++++--
 4 files changed, 32 insertions(+), 33 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 staging: wlan-ng: avoid new typedef: netdevice_t

This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: do not add new typedefs

It applies for typedef netdevice_t

---
 drivers/staging/wlan-ng/p80211conv.c   |  2 +-
 drivers/staging/wlan-ng/p80211netdev.c | 38 +++++++++++++++++-----------------
 drivers/staging/wlan-ng/p80211netdev.h |  9 +++-----
 drivers/staging/wlan-ng/prism2sta.c    |  6 ++++--
 4 files changed, 27 insertions(+), 28 deletions(-)
drivers/staging/wlan-ng/p80211conv.c +1 -1
index efc52e9..0247cbc 100644
@@ -277,7 +277,7 @@ static void orinoco_spy_gather(struct wlandevice *wlandev, char *mac,
 int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
 			struct sk_buff *skb)
 {
-	netdevice_t *netdev = wlandev->netdev;
+	struct net_device *netdev = wlandev->netdev;
 	u16 fc;
 	unsigned int payload_length;
 	unsigned int payload_offset;
drivers/staging/wlan-ng/p80211netdev.c +19 -19
index 0a31467..825a63a 100644
@@ -91,16 +91,16 @@
 #include "cfg80211.c"
 
 /* netdevice method functions */
-static int p80211knetdev_init(netdevice_t *netdev);
-static int p80211knetdev_open(netdevice_t *netdev);
-static int p80211knetdev_stop(netdevice_t *netdev);
+static int p80211knetdev_init(struct net_device *netdev);
+static int p80211knetdev_open(struct net_device *netdev);
+static int p80211knetdev_stop(struct net_device *netdev);
 static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
-					 netdevice_t *netdev);
-static void p80211knetdev_set_multicast_list(netdevice_t *dev);
-static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr,
+					 struct net_device *netdev);
+static void p80211knetdev_set_multicast_list(struct net_device *dev);
+static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr,
 				  int cmd);
-static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr);
-static void p80211knetdev_tx_timeout(netdevice_t *netdev);
+static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr);
+static void p80211knetdev_tx_timeout(struct net_device *netdev);
 static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc);
 
 int wlan_watchdog = 5000;
@@ -123,7 +123,7 @@ MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
 * Returns:
 *	nothing
 ----------------------------------------------------------------*/
-static int p80211knetdev_init(netdevice_t *netdev)
+static int p80211knetdev_init(struct net_device *netdev)
 {
 	/* Called in response to register_netdev */
 	/* This is usually the probe function, but the probe has */
@@ -146,7 +146,7 @@ static int p80211knetdev_init(netdevice_t *netdev)
 * Returns:
 *	zero on success, non-zero otherwise
 ----------------------------------------------------------------*/
-static int p80211knetdev_open(netdevice_t *netdev)
+static int p80211knetdev_open(struct net_device *netdev)
 {
 	int result = 0;		/* success */
 	struct wlandevice *wlandev = netdev->ml_priv;
@@ -181,7 +181,7 @@ static int p80211knetdev_open(netdevice_t *netdev)
 * Returns:
 *	zero on success, non-zero otherwise
 ----------------------------------------------------------------*/
-static int p80211knetdev_stop(netdevice_t *netdev)
+static int p80211knetdev_stop(struct net_device *netdev)
 {
 	int result = 0;
 	struct wlandevice *wlandev = netdev->ml_priv;
@@ -267,7 +267,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
 {
 	struct wlandevice *wlandev = (struct wlandevice *)arg;
 	struct sk_buff *skb = NULL;
-	netdevice_t *dev = wlandev->netdev;
+	struct net_device *dev = wlandev->netdev;
 
 	/* Let's empty our our queue */
 	while ((skb = skb_dequeue(&wlandev->nsd_rxq))) {
@@ -318,7 +318,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
 *	zero on success, non-zero on failure.
 ----------------------------------------------------------------*/
 static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
-					 netdevice_t *netdev)
+					 struct net_device *netdev)
 {
 	int result = 0;
 	int txresult = -1;
@@ -446,7 +446,7 @@ failed:
 * Returns:
 *	nothing
 ----------------------------------------------------------------*/
-static void p80211knetdev_set_multicast_list(netdevice_t *dev)
+static void p80211knetdev_set_multicast_list(struct net_device *dev)
 {
 	struct wlandevice *wlandev = dev->ml_priv;
 
@@ -531,7 +531,7 @@ static int p80211netdev_ethtool(struct wlandevice *wlandev, void __user *useradd
 *	Process thread (ioctl caller).  TODO: SMP support may require
 *	locks.
 ----------------------------------------------------------------*/
-static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
+static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	int result = 0;
 	struct p80211ioctl_req *req = (struct p80211ioctl_req *)ifr;
@@ -610,7 +610,7 @@ bail:
 *
 * by: Collin R. Mulliner <[email protected]>
 ----------------------------------------------------------------*/
-static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
+static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
 {
 	struct sockaddr *new_addr = addr;
 	struct p80211msg_dot11req_mibset dot11req;
@@ -669,7 +669,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
 	return result;
 }
 
-static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
+static int wlan_change_mtu(struct net_device *dev, int new_mtu)
 {
 	/* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
 	   and another 8 for wep. */
@@ -720,7 +720,7 @@ static const struct net_device_ops p80211_netdev_ops = {
 int wlan_setup(struct wlandevice *wlandev, struct device *physdev)
 {
 	int result = 0;
-	netdevice_t *netdev;
+	struct net_device *netdev;
 	struct wiphy *wiphy;
 	struct wireless_dev *wdev;
 
@@ -1071,7 +1071,7 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
 	return drop;
 }
 
-static void p80211knetdev_tx_timeout(netdevice_t *netdev)
+static void p80211knetdev_tx_timeout(struct net_device *netdev)
 {
 	struct wlandevice *wlandev = netdev->ml_priv;
 
drivers/staging/wlan-ng/p80211netdev.h +3 -6
index 222f736..5055837 100644
@@ -57,9 +57,6 @@
 #include <linux/wireless.h>
 #include <linux/netdevice.h>
 
-#undef netdevice_t
-typedef struct net_device netdevice_t;
-
 #define WLAN_RELEASE	"0.3.0-staging"
 
 #define WLAN_DEVICE_CLOSED	0
@@ -138,7 +135,7 @@ typedef struct p80211_frmrx_t {
 } p80211_frmrx_t;
 
 /* called by /proc/net/wireless */
-struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t *dev);
+struct iw_statistics *p80211wext_get_wireless_stats(struct net_device *dev);
 /* wireless extensions' ioctls */
 extern struct iw_handler_def p80211wext_handler_def;
 
@@ -186,7 +183,7 @@ struct wlandevice {
 			struct p80211_metawep *p80211_wep);
 	int (*mlmerequest)(struct wlandevice *wlandev, struct p80211msg *msg);
 	int (*set_multicast_list)(struct wlandevice *wlandev,
-				   netdevice_t *dev);
+				   struct net_device *dev);
 	void (*tx_timeout)(struct wlandevice *wlandev);
 
 	/* 802.11 State */
@@ -206,7 +203,7 @@ struct wlandevice {
 	/* netlink socket */
 	/* queue for indications waiting for cmd completion */
 	/* Linux netdevice and support */
-	netdevice_t *netdev;	/* ptr to linux netdevice */
+	struct net_device *netdev;	/* ptr to linux netdevice */
 
 	/* Rx bottom half */
 	struct tasklet_struct rx_bh;
drivers/staging/wlan-ng/prism2sta.c +4 -2
index a39b294..474e29f 100644
@@ -107,7 +107,8 @@ static int prism2sta_txframe(struct wlandevice *wlandev, struct sk_buff *skb,
 static int prism2sta_mlmerequest(struct wlandevice *wlandev, struct p80211msg *msg);
 static int prism2sta_getcardinfo(struct wlandevice *wlandev);
 static int prism2sta_globalsetup(struct wlandevice *wlandev);
-static int prism2sta_setmulticast(struct wlandevice *wlandev, netdevice_t *dev);
+static int prism2sta_setmulticast(struct wlandevice *wlandev,
+				  struct net_device *dev);
 
 static void prism2sta_inf_handover(struct wlandevice *wlandev,
 				   hfa384x_InfFrame_t *inf);
@@ -918,7 +919,8 @@ static int prism2sta_globalsetup(struct wlandevice *wlandev)
 					WLAN_DATA_MAXLEN);
 }
 
-static int prism2sta_setmulticast(struct wlandevice *wlandev, netdevice_t *dev)
+static int prism2sta_setmulticast(struct wlandevice *wlandev,
+					struct net_device *dev)
 {
 	int result = 0;
 	hfa384x_t *hw = wlandev->priv;
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 staging: wlan-ng: avoid new typedef: p80211_frmrx_t

In reply to Sergio Paracuellos

This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: do not add new typedefs

It applies for typedef p80211_frmrx_t

---
 drivers/staging/wlan-ng/p80211netdev.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wlan-ng/p80211netdev.h +3 -3
index 5055837..e1a5689 100644
@@ -98,7 +98,7 @@
 #define P80211_NSDCAP_NOSCAN                0x200 /* nsd can scan */
 
 /* Received frame statistics */
-typedef struct p80211_frmrx_t {
+struct p80211_frmrx {
 	u32 mgmt;
 	u32 assocreq;
 	u32 assocresp;
@@ -132,7 +132,7 @@ typedef struct p80211_frmrx_t {
 	u32 data_unknown;
 	u32 decrypt;
 	u32 decrypt_err;
-} p80211_frmrx_t;
+};
 
 /* called by /proc/net/wireless */
 struct iw_statistics *p80211wext_get_wireless_stats(struct net_device *dev);
@@ -211,7 +211,7 @@ struct wlandevice {
 	struct sk_buff_head nsd_rxq;
 
 	/* 802.11 device statistics */
-	struct p80211_frmrx_t rx;
+	struct p80211_frmrx rx;
 
 	struct iw_statistics wstats;
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 staging: wlan-ng: fix line style warnings in p80211netdev.h

In reply to Sergio Paracuellos

This patch fixes the following checkpatch.pl warning in p80211netdev.h:
WARNING: line over 80 characters

---
 drivers/staging/wlan-ng/p80211netdev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wlan-ng/p80211netdev.h +2 -2
index e1a5689..1e6a774 100644
@@ -225,8 +225,8 @@ struct wlandevice {
 int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen);
 int wep_decrypt(struct wlandevice *wlandev, u8 *buf, u32 len, int key_override,
 		u8 *iv, u8 *icv);
-int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
-		u8 *iv, u8 *icv);
+int wep_encrypt(struct wlandevice *wlandev, u8 *buf, u8 *dst, u32 len,
+		int keynum, u8 *iv, u8 *icv);
 
 int wlan_setup(struct wlandevice *wlandev, struct device *physdev);
 void wlan_unsetup(struct wlandevice *wlandev);
Signature · 1 line
1.9.1