diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2007-12-04 23:22:26 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:55:52 -0800 |
commit | 4c610979576d8778c401a9b1d247ed14f6cee998 (patch) | |
tree | 6755d9f6053def24e47e63c0451dccf63cbe0cc2 /net/netfilter | |
parent | 338e8a79262c3709e314fbcc7ca193323e534934 (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/netfilter')
-rw-r--r-- | net/netfilter/core.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); int nf_register_hook(struct nf_hook_ops *reg) { - struct list_head *i; + struct nf_hook_ops *elem; int err; err = mutex_lock_interruptible(&nf_hook_mutex); if (err < 0) return err; - list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) { - if (reg->priority < ((struct nf_hook_ops *)i)->priority) + list_for_each_entry(elem, &nf_hooks[reg->pf][reg->hooknum], list) { + if (reg->priority < elem->priority) break; } - list_add_rcu(®->list, i->prev); + list_add_rcu(®->list, elem->list.prev); mutex_unlock(&nf_hook_mutex); return 0; } |