Commit 4c610979 authored by Li Zefan's avatar Li Zefan Committed by David S. Miller

[NETFILTER]: replace list_for_each with list_for_each_entry

Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 338e8a79
...@@ -109,11 +109,9 @@ clusterip_config_entry_put(struct clusterip_config *c) ...@@ -109,11 +109,9 @@ clusterip_config_entry_put(struct clusterip_config *c)
static struct clusterip_config * static struct clusterip_config *
__clusterip_config_find(__be32 clusterip) __clusterip_config_find(__be32 clusterip)
{ {
struct list_head *pos; struct clusterip_config *c;
list_for_each(pos, &clusterip_configs) { list_for_each_entry(c, &clusterip_configs, list) {
struct clusterip_config *c = list_entry(pos,
struct clusterip_config, list);
if (c->clusterip == clusterip) if (c->clusterip == clusterip)
return c; return c;
} }
......
...@@ -62,17 +62,17 @@ static DEFINE_MUTEX(nf_hook_mutex); ...@@ -62,17 +62,17 @@ static DEFINE_MUTEX(nf_hook_mutex);
int nf_register_hook(struct nf_hook_ops *reg) int nf_register_hook(struct nf_hook_ops *reg)
{ {
struct list_head *i; struct nf_hook_ops *elem;
int err; int err;
err = mutex_lock_interruptible(&nf_hook_mutex); err = mutex_lock_interruptible(&nf_hook_mutex);
if (err < 0) if (err < 0)
return err; return err;
list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) { list_for_each_entry(elem, &nf_hooks[reg->pf][reg->hooknum], list) {
if (reg->priority < ((struct nf_hook_ops *)i)->priority) if (reg->priority < elem->priority)
break; break;
} }
list_add_rcu(&reg->list, i->prev); list_add_rcu(&reg->list, elem->list.prev);
mutex_unlock(&nf_hook_mutex); mutex_unlock(&nf_hook_mutex);
return 0; return 0;
} }
......
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