Commit c8037cbe authored by Maximilian Attems's avatar Maximilian Attems Committed by Jeff Garzik

[NET]: Use list_for_each() where applicable.

parent e50a1046
...@@ -1794,7 +1794,7 @@ static void *rfcomm_seq_next(struct seq_file *seq, void *e, loff_t *pos) ...@@ -1794,7 +1794,7 @@ static void *rfcomm_seq_next(struct seq_file *seq, void *e, loff_t *pos)
if (p->next != &s->dlcs) if (p->next != &s->dlcs)
return p->next; 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); s = list_entry(p, struct rfcomm_session, list);
__list_for_each(pp, &s->dlcs) { __list_for_each(pp, &s->dlcs) {
seq->private = s; seq->private = s;
......
...@@ -101,7 +101,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg) ...@@ -101,7 +101,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg)
if (down_interruptible(&nf_sockopt_mutex) != 0) if (down_interruptible(&nf_sockopt_mutex) != 0)
return -EINTR; 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; struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;
if (ops->pf == reg->pf if (ops->pf == reg->pf
&& (overlap(ops->set_optmin, ops->set_optmax, && (overlap(ops->set_optmin, ops->set_optmax,
...@@ -296,7 +296,7 @@ static int nf_sockopt(struct sock *sk, int pf, int val, ...@@ -296,7 +296,7 @@ static int nf_sockopt(struct sock *sk, int pf, int val,
if (down_interruptible(&nf_sockopt_mutex) != 0) if (down_interruptible(&nf_sockopt_mutex) != 0)
return -EINTR; 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; ops = (struct nf_sockopt_ops *)i;
if (ops->pf == pf) { if (ops->pf == pf) {
if (get) { if (get) {
......
...@@ -150,8 +150,7 @@ list_conntracks(char *buffer, char **start, off_t offset, int length) ...@@ -150,8 +150,7 @@ list_conntracks(char *buffer, char **start, off_t offset, int length)
} }
/* Now iterate through expecteds. */ /* Now iterate through expecteds. */
for (e = ip_conntrack_expect_list.next; list_for_each(e, &ip_conntrack_expect_list) {
e != &ip_conntrack_expect_list; e = e->next) {
unsigned int last_len; unsigned int last_len;
struct ip_conntrack_expect *expect struct ip_conntrack_expect *expect
= (struct ip_conntrack_expect *)e; = (struct ip_conntrack_expect *)e;
...@@ -319,7 +318,7 @@ int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto) ...@@ -319,7 +318,7 @@ int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto)
struct list_head *i; struct list_head *i;
WRITE_LOCK(&ip_conntrack_lock); 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 if (((struct ip_conntrack_protocol *)i)->proto
== proto->proto) { == proto->proto) {
ret = -EBUSY; ret = -EBUSY;
......
...@@ -271,7 +271,7 @@ int ip_nat_protocol_register(struct ip_nat_protocol *proto) ...@@ -271,7 +271,7 @@ int ip_nat_protocol_register(struct ip_nat_protocol *proto)
struct list_head *i; struct list_head *i;
WRITE_LOCK(&ip_nat_lock); 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 if (((struct ip_nat_protocol *)i)->protonum
== proto->protonum) { == proto->protonum) {
ret = -EBUSY; ret = -EBUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment