[NET]: dev_put/dev_hold cleanup
authorStephen Hemminger <shemminger@osdl.org>
Tue, 21 Mar 2006 06:32:28 +0000 (22:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 06:32:28 +0000 (22:32 -0800)
Get rid of the old __dev_put macro that is just a hold over from pre 2.6
kernel.  And turn dev_hold into an inline instead of a macro.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/e1000/e1000_main.c
include/linux/netdevice.h
net/ipv4/igmp.c
net/ipv4/ipmr.c
net/sched/sch_generic.c

index f39de16e6b9730769ab00cd759ba78c8fe6e86b5..49cd096a3c3d03a92a2185265d77acfa599f4447 100644 (file)
@@ -920,7 +920,7 @@ e1000_remove(struct pci_dev *pdev)
        unregister_netdev(netdev);
 #ifdef CONFIG_E1000_NAPI
        for (i = 0; i < adapter->num_rx_queues; i++)
-               __dev_put(&adapter->polling_netdev[i]);
+               dev_put(&adapter->polling_netdev[i]);
 #endif
 
        if (!e1000_check_phy_reset_block(&adapter->hw))
index b825be201bce0ee3504d0e2ae54e69fad77c005e..950dc55e519280fde2a0339b7ee65578b7d71290 100644 (file)
@@ -712,8 +712,10 @@ static inline void dev_put(struct net_device *dev)
        atomic_dec(&dev->refcnt);
 }
 
-#define __dev_put(dev) atomic_dec(&(dev)->refcnt)
-#define dev_hold(dev) atomic_inc(&(dev)->refcnt)
+static inline void dev_hold(struct net_device *dev)
+{
+       atomic_inc(&dev->refcnt);
+}
 
 /* Carrier loss detection, dial on demand. The functions netif_carrier_on
  * and _off may be called from IRQ context, but it is caller
index 3ec502f19da0e347a621b0ad848e33c20a419901..d512239a14731a0690e184f6340221f06c4a0b18 100644 (file)
@@ -1382,7 +1382,7 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
                dev = ip_dev_find(imr->imr_address.s_addr);
                if (!dev)
                        return NULL;
-               __dev_put(dev);
+               dev_put(dev);
        }
 
        if (!dev && !ip_route_output_key(&rt, &fl)) {
index 5c94c222e3f382a3fce0f9d4efb0e05fa29d9056..717ab7d6d7b6eb47d48f74b83623c45b820547d3 100644 (file)
@@ -415,10 +415,10 @@ static int vif_add(struct vifctl *vifc, int mrtsock)
                        return -ENOBUFS;
                break;
        case 0:
-               dev=ip_dev_find(vifc->vifc_lcl_addr.s_addr);
+               dev = ip_dev_find(vifc->vifc_lcl_addr.s_addr);
                if (!dev)
                        return -EADDRNOTAVAIL;
-               __dev_put(dev);
+               dev_put(dev);
                break;
        default:
                return -EINVAL;
index 99ceb91f0150a158aa926c3c3ebeb13d1860cbd4..31eb83717c267a799b013f073cfe3e99301709d9 100644 (file)
@@ -234,7 +234,7 @@ static void dev_watchdog_down(struct net_device *dev)
 {
        spin_lock_bh(&dev->xmit_lock);
        if (del_timer(&dev->watchdog_timer))
-               __dev_put(dev);
+               dev_put(dev);
        spin_unlock_bh(&dev->xmit_lock);
 }