]> err.no Git - linux-2.6/commitdiff
[NET]: dst_ifdown() cleanup
authorEric Dumazet <dada1@cosmosbay.com>
Tue, 11 Dec 2007 10:00:30 +0000 (02:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:57:05 +0000 (14:57 -0800)
This cleanup shrinks size of net/core/dst.o on i386 from 1299 to 1289 bytes.
(This is because dev_hold()/dev_put() are doing atomic_inc()/atomic_dec() and
force compiler to re-evaluate memory contents.)

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dst.c

index 5c6cfc4e7fdbe2bcaf393b9e1692834cfe3c0b74..7eceebaabaaaf79d589eb3e9f5478a4a98d0fa0f 100644 (file)
@@ -284,8 +284,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
                dev_put(dev);
                if (dst->neighbour && dst->neighbour->dev == dev) {
                        dst->neighbour->dev = dst->dev;
+                       dev_hold(dst->dev);
                        dev_put(dev);
-                       dev_hold(dst->neighbour->dev);
                }
        }
 }