aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2007-12-05 02:22:26 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:52 -0500
commit4c610979576d8778c401a9b1d247ed14f6cee998 (patch)
tree6755d9f6053def24e47e63c0451dccf63cbe0cc2 /net
parent338e8a79262c3709e314fbcc7ca193323e534934 (diff)
[NETFILTER]: replace list_for_each with list_for_each_entry
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c6
-rw-r--r--net/netfilter/core.c8
2 files changed, 6 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 2f544dac72d..311361e1272 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -109,11 +109,9 @@ clusterip_config_entry_put(struct clusterip_config *c)
109static struct clusterip_config * 109static struct clusterip_config *
110__clusterip_config_find(__be32 clusterip) 110__clusterip_config_find(__be32 clusterip)
111{ 111{
112 struct list_head *pos; 112 struct clusterip_config *c;
113 113
114 list_for_each(pos, &clusterip_configs) { 114 list_for_each_entry(c, &clusterip_configs, list) {
115 struct clusterip_config *c = list_entry(pos,
116 struct clusterip_config, list);
117 if (c->clusterip == clusterip) 115 if (c->clusterip == clusterip)
118 return c; 116 return c;
119 } 117 }
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 631d2694831..e6d3a69b9e9 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -62,17 +62,17 @@ static DEFINE_MUTEX(nf_hook_mutex);
62 62
63int nf_register_hook(struct nf_hook_ops *reg) 63int nf_register_hook(struct nf_hook_ops *reg)
64{ 64{
65 struct list_head *i; 65 struct nf_hook_ops *elem;
66 int err; 66 int err;
67 67
68 err = mutex_lock_interruptible(&nf_hook_mutex); 68 err = mutex_lock_interruptible(&nf_hook_mutex);
69 if (err < 0) 69 if (err < 0)
70 return err; 70 return err;
71 list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) { 71 list_for_each_entry(elem, &nf_hooks[reg->pf][reg->hooknum], list) {
72 if (reg->priority < ((struct nf_hook_ops *)i)->priority) 72 if (reg->priority < elem->priority)
73 break; 73 break;
74 } 74 }
75 list_add_rcu(&reg->list, i->prev); 75 list_add_rcu(&reg->list, elem->list.prev);
76 mutex_unlock(&nf_hook_mutex); 76 mutex_unlock(&nf_hook_mutex);
77 return 0; 77 return 0;
78} 78}