]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[NET]: move dev_mc_discard from dev_mcast.c to dev.c
authorDenis Cheng <crquan@gmail.com>
Wed, 18 Jul 2007 09:10:54 +0000 (02:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jul 2007 09:10:54 +0000 (02:10 -0700)
Because this function is only called by unregister_netdevice,
this moving could make this non-global function static,
and also remove its declaration in netdevice.h;

Any further, function __dev_addr_discard is also just called by
dev_mc_discard and dev_unicast_discard, keeping this two functions
both in one c file could make __dev_addr_discard also static
and remove its declaration in netdevice.h;

Futhermore, 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/core/dev_mcast.c

index da7a13c97eb8c2ae21048724be12ec60ca0bf927..9820ca1e45e251fde417743e4ee1ac98c65937d4 100644 (file)
@@ -1098,10 +1098,8 @@ 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);
 extern void            dev_set_promiscuity(struct net_device *dev, int inc);
 extern void            dev_set_allmulti(struct net_device *dev, int inc);
 extern void            netdev_state_change(struct net_device *dev);
index 13a0d9f6da54c02cbed38292ddef7eaa1d9241a0..3ba63aaa3001737adc66d7d9feba6317e5674aeb 100644 (file)
@@ -2715,7 +2715,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count,
        return 0;
 }
 
-void __dev_addr_discard(struct dev_addr_list **list)
+static void __dev_addr_discard(struct dev_addr_list **list)
 {
        struct dev_addr_list *tmp;
 
@@ -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;
index 235a2a8a0d05b0b2163c180001f918274720a785..99aece1aeccff9aa950c3b8bb08385b8dd2b2b25 100644 (file)
@@ -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)
 {