* [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
* Re: [KJ] [PATCH 2.4.28 1/1] networking: improve readability of
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
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Domen Puncer @ 2005-06-18 11:38 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
Hi!
On 18/06/05 04:40 -0400, David wrote:
> 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.
2.4 is pretty much closed for everything but bug-fixes.
Create patches against latest 2.6.x-rcY (or release if no -rc yet).
That said, I see no beginner mistakes in patch, good work!
Domen
[-- 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
* Re: [KJ] [PATCH 2.4.28 1/1] networking: improve readability of
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
3 siblings, 0 replies; 5+ messages in thread
From: David @ 2005-06-18 18:02 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 922 bytes --]
On Sat 18 Jun 2005 13:38 Domen Puncer <domen@coderock.org> wrote:
> 2.4 is pretty much closed for everything but bug-fixes.
> Create patches against latest 2.6.x-rcY (or release if no -rc yet).
>
> That said, I see no beginner mistakes in patch, good work!
>
> Domen
OK, here's a version of the patch against the 2.6.12 sources:
--- linux-2.6.12/net/core/dev.c 2005-06-18 13:53:28.000000000 -0400
+++ linux-2.6.12/net/core/dev.c 2005-06-18 13:56:13.000000000 -0400
@@ -2190,10 +2190,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) {
dev_mc_upload(dev);
printk(KERN_INFO "device %s %s promiscuous mode\n",
dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
[-- 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
* Re: [KJ] [PATCH 2.4.28 1/1] networking: improve readability of
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
3 siblings, 0 replies; 5+ messages in thread
From: Domen Puncer @ 2005-06-19 8:41 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 219 bytes --]
On 18/06/05 14:02 -0400, David wrote:
...
>
> OK, here's a version of the patch against the 2.6.12 sources:
>
Missing description, Signed-off-by.
> --- linux-2.6.12/net/core/dev.c 2005-06-18 13:53:28.000000000 -0400
[-- 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
* Re: [KJ] [PATCH 2.4.28 1/1] networking: improve readability of
2005-06-18 8:40 [KJ] [PATCH 2.4.28 1/1] networking: improve readability of David
` (2 preceding siblings ...)
2005-06-19 8:41 ` Domen Puncer
@ 2005-06-20 1:20 ` David
3 siblings, 0 replies; 5+ messages in thread
From: David @ 2005-06-20 1:20 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
On Sun 19 Jun 2005 10:41 Domen Puncer <domen@coderock.org> wrote:
> Missing description, Signed-off-by.
Alright, let's try that again:
Patch against 2.6.12. 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-2.6.12/net/core/dev.c 2005-06-18 13:53:28.000000000 -0400
+++ linux-2.6.12/net/core/dev.c 2005-06-18 13:56:13.000000000 -0400
@@ -2190,10 +2190,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) {
dev_mc_upload(dev);
printk(KERN_INFO "device %s %s promiscuous mode\n",
dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
[-- 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.