Skip to contentSkip to conversation

Staging: wilc1000: Code cleanup

PATCH Superseded Bhumika Goyal 2 participants 9 messages Sep 19, 2016 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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.

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 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.

---
 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 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.

---
 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
#3 lore raw
In reply to Bhumika Goyal
Quoted 3 lines · Bhumika Goyal

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

Isn't this a v2?

julia

Quoted 20 lines

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(-)

--
1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 10 lines · Julia Lawall
Quoted 3 lines · Bhumika Goyal

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

Isn't this a v2?

julia

Actually, yes but they weren't sent as a patchset before. I realized that in order to make them work they need to be applied in series and so I combined them in a patchset. Do I need to put a v2 then?

Thanks,
Bhumika

Quoted 20 lines
Quoted 20 lines

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(-)

--
1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw
Quoted 7 lines · Bhumika Goyal
Quoted 6 lines · Julia Lawall
Quoted 3 lines · Bhumika Goyal

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

Quoted 7 lines
Quoted 4 lines

Isn't this a v2?

julia

Actually, yes but they weren't sent as a patchset before. I realized that in order to make them work they need to be applied in series and so I combined them in a patchset. Do I need to put a v2 then?

I think it would make clear that there was something else from before that should now be ignored.

julia

Quoted 32 lines

Thanks,
Bhumika

Quoted 13 lines
Quoted 13 lines

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(-)

--
1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jH%3DKx%3DhT8DZ4stQf5touCUeUofcJ9H50A3%2BodUK12r8cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw
Quoted 13 lines · Julia Lawall
Quoted 9 lines · Bhumika Goyal
Quoted 8 lines · Julia Lawall
Quoted 3 lines · Bhumika Goyal

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

Isn't this a v2?

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

julia

Actually, yes but they weren't sent as a patchset before. I realized that in order to make them work they need to be applied in series and so I combined them in a patchset. Do I need to put a v2 then?

I think it would make clear that there was something else from before that should now be ignored.

Ok, but now is it still a v2 or a v3?

Thanks,
Bhumika

Quoted 34 lines

julia

Quoted 32 lines

Thanks,
Bhumika

Quoted 13 lines
Quoted 13 lines

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(-)

--
1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jH%3DKx%3DhT8DZ4stQf5touCUeUofcJ9H50A3%2BodUK12r8cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw
Quoted 20 lines · Bhumika Goyal
Quoted 19 lines · Julia Lawall
Quoted 14 lines · Bhumika Goyal
Quoted 10 lines · Julia Lawall
Quoted 3 lines · Bhumika Goyal

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

Isn't this a v2?

julia

Actually, yes but they weren't sent as a patchset before. I realized that in order to make them work they need to be applied in series and so I combined them in a patchset. Do I need to put a v2 then?

Quoted 5 lines
Quoted 3 lines

I think it would make clear that there was something else from before that should now be ignored.

Ok, but now is it still a v2 or a v3?

No idea :) Whatever is one larger than where you were before.

julia

Quoted 46 lines

Thanks,
Bhumika

Quoted 34 lines

julia

Quoted 32 lines

Thanks,
Bhumika

Quoted 13 lines
Quoted 13 lines

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(-)

--
1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jH%3DKx%3DhT8DZ4stQf5touCUeUofcJ9H50A3%2BodUK12r8cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jFvcwZHT%3D%2B4RkKSt9qXuHFXw_uSit8iJa67%3D8dBU3pasg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw
Quoted 24 lines · Julia Lawall
Quoted 20 lines · Bhumika Goyal
Quoted 19 lines · Julia Lawall
Quoted 14 lines · Bhumika Goyal
Quoted 10 lines · Julia Lawall
Quoted 3 lines · Bhumika Goyal

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

Isn't this a v2?

julia

Actually, yes but they weren't sent as a patchset before. I realized that in order to make them work they need to be applied in series and so I combined them in a patchset. Do I need to put a v2 then?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I think it would make clear that there was something else from before that should now be ignored.

Ok, but now is it still a v2 or a v3?

No idea :) Whatever is one larger than where you were before.

Ok :D

Thanks,
Bhumika

Quoted 48 lines

julia

Quoted 46 lines

Thanks,
Bhumika

Quoted 34 lines

julia

Quoted 32 lines

Thanks,
Bhumika

Quoted 13 lines
Quoted 13 lines

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(-)

--
1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474293770-22208-1-git-send-email-bhumirks%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jH%3DKx%3DhT8DZ4stQf5touCUeUofcJ9H50A3%2BodUK12r8cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/CAOH%2B1jFvcwZHT%3D%2B4RkKSt9qXuHFXw_uSit8iJa67%3D8dBU3pasg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.