public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] [NET] move dev_mc_discard from dev_mcast.c to dev.c
@ 2007-07-17  8:23 Denis Cheng
  2007-07-17  8:23 ` [PATCH 2/4] [NET] make non-global function __dev_addr_discard static Denis Cheng
  2007-07-18  2:41 ` [PATCH 1/3] [net/core] move dev_mc_discard from dev_mcast.c to dev.c Denis Cheng
  0 siblings, 2 replies; 22+ messages in thread
From: Denis Cheng @ 2007-07-17  8:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel, Denis Cheng

because this function is only called by unregister_netdevice,
this moving could make this non-global function static,
and also remove a function declaration in netdevice.h

another way, the sequential call to dev_unicast_discard and then
dev_mc_discard in unregister_netdevice have a similar mechanism that:
(netif_tx_lock_bh / __dev_addr_discard / netif_tx_unlock_bh),
they should merged into one to eliminate duplicates in acquiring and
releasing the dev->_xmit_lock, this would be done in my following patch.

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 include/linux/netdevice.h |    1 -
 net/core/dev.c            |   12 ++++++++++++
 net/core/dev_mcast.c      |   12 ------------
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 322b5ea..895cec2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1108,7 +1108,6 @@ extern int 		dev_mc_delete(struct net_device *dev, void *addr, int alen, int all
 extern int		dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
 extern int		dev_mc_sync(struct net_device *to, struct net_device *from);
 extern void		dev_mc_unsync(struct net_device *to, struct net_device *from);
-extern void		dev_mc_discard(struct net_device *dev);
 extern int 		__dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
 extern int		__dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
 extern void		__dev_addr_discard(struct dev_addr_list **list);
diff --git a/net/core/dev.c b/net/core/dev.c
index 13a0d9f..b17f1bf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2785,6 +2785,18 @@ static void dev_unicast_discard(struct net_device *dev)
 	netif_tx_unlock_bh(dev);
 }
 
+/*
+ *	Discard multicast list when a device is downed
+ */
+
+static void dev_mc_discard(struct net_device *dev)
+{
+	netif_tx_lock_bh(dev);
+	__dev_addr_discard(&dev->mc_list);
+	dev->mc_count = 0;
+	netif_tx_unlock_bh(dev);
+}
+
 unsigned dev_get_flags(const struct net_device *dev)
 {
 	unsigned flags;
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 235a2a8..99aece1 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -177,18 +177,6 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
 }
 EXPORT_SYMBOL(dev_mc_unsync);
 
-/*
- *	Discard multicast list when a device is downed
- */
-
-void dev_mc_discard(struct net_device *dev)
-{
-	netif_tx_lock_bh(dev);
-	__dev_addr_discard(&dev->mc_list);
-	dev->mc_count = 0;
-	netif_tx_unlock_bh(dev);
-}
-
 #ifdef CONFIG_PROC_FS
 static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
 {
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-07-20  3:23 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17  8:23 [PATCH 1/4] [NET] move dev_mc_discard from dev_mcast.c to dev.c Denis Cheng
2007-07-17  8:23 ` [PATCH 2/4] [NET] make non-global function __dev_addr_discard static Denis Cheng
2007-07-17  8:23   ` [PATCH 3/4] [NET] merge dev_unicast_discard and dev_mc_discard into one Denis Cheng
2007-07-17  8:23     ` [PATCH 4/4] [NET] move __dev_addr_discard adjacent to dev_addr_discard for readability Denis Cheng
2007-07-18  2:41 ` [PATCH 1/3] [net/core] move dev_mc_discard from dev_mcast.c to dev.c Denis Cheng
2007-07-18  2:41   ` [PATCH 2/3] [net/core] merge dev_unicast_discard and dev_mc_discard into one Denis Cheng
2007-07-18  2:41     ` [PATCH 3/3] [net/core] move __dev_addr_discard adjacent to dev_addr_discard for readability Denis Cheng
2007-07-18  9:13       ` David Miller
2007-07-18  9:12     ` [PATCH 2/3] [net/core] merge dev_unicast_discard and dev_mc_discard into one David Miller
2007-07-18  9:11   ` [PATCH 1/3] [net/core] move dev_mc_discard from dev_mcast.c to dev.c David Miller
2007-07-18  9:59     ` rae l
2007-07-18 10:01       ` Patrick McHardy
2007-07-18 10:04         ` David Miller
2007-07-18 10:10           ` Patrick McHardy
2007-07-18 10:03       ` David Miller
2007-07-18 11:30         ` [PATCH 1/2] net/core: merge the content of dev_mcast.c into dev.c Denis Cheng
2007-07-18 11:30           ` [PATCH 2/2] net/core: some functions' definition order adjustment for readability Denis Cheng
2007-07-18 12:39             ` Patrick McHardy
2007-07-18 14:31               ` rae l
2007-07-20  1:51           ` [PATCH 1/2] net/core: merge the content of dev_mcast.c into dev.c rae l
2007-07-20  3:04             ` David Miller
2007-07-20  3:22               ` rae l

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox