Skip to contentSkip to conversation

Staging: wilc1000: Code cleanup

PATCH New Bhumika Goyal 1 participant 3 messages Sep 19, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v3 cover Staging: wilc1000: Code cleanup

This patchset declares some functions as static and remove their declaration from headers. Also, drop prototypes of some already static functions.

Changes in v2:
- Combine both the patches into a patchset.
- Rebuild patch 2/2.
- Correct subject and commit message of patch 1/2.

Changes in v3:
- Sending v3 as "v2" was not prefixed in subject line.

Bhumika Goyal (2):
Staging: wilc1000: Drop static function prototypes
Staging: wilc1000: Make functions wilc_mac_{open/close} static

 drivers/staging/wilc1000/linux_wlan.c             | 30 ++++++++++-------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  3 ---
 drivers/staging/wilc1000/wilc_wlan.h              |  3 ---
 3 files changed, 13 insertions(+), 23 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/2 Staging: wilc1000: Drop static function prototypes

Drop the prototypes of some static functions. To be compatible with the changes move the declaration of wilc_netdev_ops structure lower in the file, after the definition of these functions used in its initializer.

---
Changes in v2:
- Combine it into a patchset.
- Correct the subject line and commit message. Changes in v3:
- Sending v3 as "v2" was not prefixed in subject line.

 drivers/staging/wilc1000/linux_wlan.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +11 -15
index 6370a5e..7242532 100644
@@ -34,24 +34,9 @@ static int wlan_deinit_locks(struct net_device *dev);
 static void wlan_deinitialize_threads(struct net_device *dev);
 
 static void linux_wlan_tx_complete(void *priv, int status);
-static int  mac_init_fn(struct net_device *ndev);
-static struct net_device_stats *mac_stats(struct net_device *dev);
-static int  mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd);
-static void wilc_set_multicast_list(struct net_device *dev);
 
 bool wilc_enable_ps = true;
 
-static const struct net_device_ops wilc_netdev_ops = {
-	.ndo_init = mac_init_fn,
-	.ndo_open = wilc_mac_open,
-	.ndo_stop = wilc_mac_close,
-	.ndo_start_xmit = wilc_mac_xmit,
-	.ndo_do_ioctl = mac_ioctl,
-	.ndo_get_stats = mac_stats,
-	.ndo_set_rx_mode  = wilc_set_multicast_list,
-
-};
-
 static int dev_state_ev_handler(struct notifier_block *this,
 				unsigned long event, void *ptr)
 {
@@ -1244,6 +1229,17 @@ void wilc_netdev_cleanup(struct wilc *wilc)
 }
 EXPORT_SYMBOL_GPL(wilc_netdev_cleanup);
 
+static const struct net_device_ops wilc_netdev_ops = {
+	.ndo_init = mac_init_fn,
+	.ndo_open = wilc_mac_open,
+	.ndo_stop = wilc_mac_close,
+	.ndo_start_xmit = wilc_mac_xmit,
+	.ndo_do_ioctl = mac_ioctl,
+	.ndo_get_stats = mac_stats,
+	.ndo_set_rx_mode  = wilc_set_multicast_list,
+
+};
+
 int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
 		     int gpio, const struct wilc_hif_func *ops)
 {
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 2/2 Staging: wilc1000: Make functions wilc_mac_{open/close} static

In reply to Bhumika Goyal

The functions wilc_mac_{open/close} are used only in linux_wlan.c. Therefore, declare them static and remove their declaration from header wilc_wlan.h and also remove their extern declaration from wilc_wfi_cfgoperations.c.

---
Changes in v2:
- Combine it into a patchset.
- Rebuild.
Changes in v3:
- Sending v3 as "v2" was not prefixed in subject line.

drivers/staging/wilc1000/linux_wlan.c | 4 ++--

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
 drivers/staging/wilc1000/wilc_wlan.h              | 3 ---
 3 files changed, 2 insertions(+), 8 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +2 -2
index 7242532..118bff5 100644
@@ -832,7 +832,7 @@ static int mac_init_fn(struct net_device *ndev)
 	return 0;
 }
 
-int wilc_mac_open(struct net_device *ndev)
+static int wilc_mac_open(struct net_device *ndev)
 {
 	struct wilc_vif *vif;
 
@@ -1023,7 +1023,7 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 	return 0;
 }
 
-int wilc_mac_close(struct net_device *ndev)
+static int wilc_mac_close(struct net_device *ndev)
 {
 	struct wilc_priv *priv;
 	struct wilc_vif *vif;
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -3
index 2c2e8ac..3b26130 100644
@@ -90,9 +90,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
 #define IS_MGMT_STATUS_SUCCES			0x040
 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
 
-extern int wilc_mac_open(struct net_device *ndev);
-extern int wilc_mac_close(struct net_device *ndev);
-
 static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
 static u32 last_scanned_cnt;
 struct timer_list wilc_during_ip_timer;
drivers/staging/wilc1000/wilc_wlan.h +0 -3
index de6c4dd..f336f4c 100644
@@ -297,9 +297,6 @@ void wilc_enable_tcp_ack_filter(bool value);
 int wilc_wlan_get_num_conn_ifcs(struct wilc *);
 int wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev);
 
-int wilc_mac_open(struct net_device *ndev);
-int wilc_mac_close(struct net_device *ndev);
-
 void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
 void host_wakeup_notify(struct wilc *wilc);
 void host_sleep_notify(struct wilc *wilc);
Signature · 1 line
1.9.1