netdev
[Top] [All Lists]

[PATCH] list_for_each net/

To: kj <kernel-janitors@xxxxxxxx>
Subject: [PATCH] list_for_each net/
From: maximilian attems <janitor@xxxxxxxxxxxxxx>
Date: Wed, 3 Sep 2003 10:22:02 +0200
Cc: netfilter-devel@xxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, marcel@xxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
again pure cosmetical changes!!
i checked the FOR_WALKERS and it seems to work.
- for (list = ymf_devs.next; list != &ymf_devs; list = list->next) {
+ list_for_each(list, &ymf_devs) {
tested, please apply

a++ maks


 bluetooth/rfcomm/core.c                  |    2 +-
 core/netfilter.c                         |    4 ++--
 ipv4/netfilter/ip_conntrack_standalone.c |    5 ++---
 ipv4/netfilter/ip_nat_standalone.c       |    2 +-
 ipv6/ip6_fib.c                           |    2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)

--- linux-2.6.0-test4/net/core/netfilter.c      Sat Aug 23 01:55:34 2003
+++ linux/net/core/netfilter.c  Wed Sep  3 09:55:25 2003
@@ -101,7 +101,7 @@
        if (down_interruptible(&nf_sockopt_mutex) != 0)
                return -EINTR;
 
-       for (i = nf_sockopts.next; i != &nf_sockopts; i = i->next) {
+       list_for_each(i, &nf_sockopts) {
                struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;
                if (ops->pf == reg->pf
                    && (overlap(ops->set_optmin, ops->set_optmax, 
@@ -296,7 +296,7 @@
        if (down_interruptible(&nf_sockopt_mutex) != 0)
                return -EINTR;
 
-       for (i = nf_sockopts.next; i != &nf_sockopts; i = i->next) {
+       list_for_each(i, &nf_sockopts) {
                ops = (struct nf_sockopt_ops *)i;
                if (ops->pf == pf) {
                        if (get) {


--- linux-2.6.0-test4/net/ipv4/netfilter/ip_conntrack_standalone.c      Sat Aug 
23 01:55:11 2003
+++ linux/net/ipv4/netfilter/ip_conntrack_standalone.c  Wed Sep  3 09:56:47 2003
@@ -151,8 +151,7 @@
        }
 
        /* Now iterate through expecteds. */
-       for (e = ip_conntrack_expect_list.next; 
-            e != &ip_conntrack_expect_list; e = e->next) {
+       list_for_each(e, &ip_conntrack_expect_list) {
                unsigned int last_len;
                struct ip_conntrack_expect *expect
                        = (struct ip_conntrack_expect *)e;
@@ -320,7 +319,7 @@
        struct list_head *i;
 
        WRITE_LOCK(&ip_conntrack_lock);
-       for (i = protocol_list.next; i != &protocol_list; i = i->next) {
+       list_for_each(i, &protocol_list) {
                if (((struct ip_conntrack_protocol *)i)->proto
                    == proto->proto) {
                        ret = -EBUSY;


--- linux-2.6.0-test4/net/ipv4/netfilter/ip_nat_standalone.c    Sat Aug 23 
01:58:40 2003
+++ linux/net/ipv4/netfilter/ip_nat_standalone.c        Wed Sep  3 09:57:27 2003
@@ -272,7 +272,7 @@
        struct list_head *i;
 
        WRITE_LOCK(&ip_nat_lock);
-       for (i = protos.next; i != &protos; i = i->next) {
+       list_for_each(i, &protos) {
                if (((struct ip_nat_protocol *)i)->protonum
                    == proto->protonum) {
                        ret = -EBUSY;


--- linux-2.6.0-test4/net/bluetooth/rfcomm/core.c       Sat Aug 23 01:50:53 2003
+++ linux/net/bluetooth/rfcomm/core.c   Wed Sep  3 09:58:11 2003
@@ -1794,7 +1794,7 @@
        if (p->next != &s->dlcs)
                return p->next;
 
-       for (p = s->list.next; p != &session_list; p = p->next) {
+       list_for_each(p, &session_list) {
                s = list_entry(p, struct rfcomm_session, list);
                __list_for_each(pp, &s->dlcs) {
                        seq->private = s;


--- linux-2.6.0-test4/net/ipv6/ip6_fib.c        Sat Aug 23 01:58:45 2003
+++ linux/net/ipv6/ip6_fib.c    Wed Sep  3 10:00:51 2003
@@ -99,7 +99,7 @@
        .next   = &fib6_walker_list, 
 };
 
-#define FOR_WALKERS(w) for ((w)=fib6_walker_list.next; (w) != 
&fib6_walker_list; (w)=(w)->next)
+#define FOR_WALKERS(w) list_for_each((w), &fib6_walker_list)
 
 static __inline__ u32 fib6_new_sernum(void)
 {


Attachment: pgpeeQgPlnps0.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>