All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 2.4.28 1/1] networking: improve readability of
@ 2005-06-18  8:40 David
  2005-06-18 11:38 ` Domen Puncer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David @ 2005-06-18  8:40 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

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>

--- linux/net/core/dev.c.bak	2005-06-18 03:45:37.000000000 -0400
+++ linux/net/core/dev.c	2005-06-18 03:55:44.000000000 -0400
@@ -1952,10 +1952,11 @@ void dev_set_promiscuity(struct net_devi
 {
 	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) {
 #ifdef CONFIG_NET_FASTROUTE
 		if (dev->flags&IFF_PROMISC) {
 			netdev_fastroute_obstacles++;

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-20  1:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-18  8:40 [KJ] [PATCH 2.4.28 1/1] networking: improve readability of David
2005-06-18 11:38 ` Domen Puncer
2005-06-18 18:02 ` David
2005-06-19  8:41 ` Domen Puncer
2005-06-20  1:20 ` David

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.