]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: improve readability of dev_set_promiscuity() in net/core/dev.c
authorDavid Chau <ddcc@mit.edu>
Tue, 5 Jul 2005 22:11:06 +0000 (15:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2005 22:11:06 +0000 (15:11 -0700)
A trivial patch to improve the readability of dev_set_promiscuity()
in net/core/dev.c. New code does exactly the same thing as original
code.

Signed-off-by: David Chau <ddcc@mit.edu>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 7016e0c36b3d904abda32faa03d46c246e584915..7f5f62c651156683734b0adf2c4aea31cb2f846f 100644 (file)
@@ -2089,10 +2089,11 @@ void dev_set_promiscuity(struct net_device *dev, int inc)
 {
        unsigned short old_flags = dev->flags;
 
-       dev->flags |= IFF_PROMISC;
        if ((dev->promiscuity += inc) == 0)
                dev->flags &= ~IFF_PROMISC;
-       if (dev->flags ^ old_flags) {
+       else
+               dev->flags |= IFF_PROMISC;
+       if (dev->flags != old_flags) {
                dev_mc_upload(dev);
                printk(KERN_INFO "device %s %s promiscuous mode\n",
                       dev->name, (dev->flags & IFF_PROMISC) ? "entered" :