From: David Chau Date: Tue, 5 Jul 2005 22:11:06 +0000 (-0700) Subject: [NET]: improve readability of dev_set_promiscuity() in net/core/dev.c X-Git-Tag: v2.6.13-rc2~6^2~20 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52609c0b56d7c8dfb6e16ec0a715adf8fcbdae36;p=linux-2.6 [NET]: improve readability of dev_set_promiscuity() in net/core/dev.c 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 Signed-off-by: Domen Puncer Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 7016e0c36b..7f5f62c651 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -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" :