summaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorAaron Conole <aconole@bytheb.org>2016-11-15 17:48:46 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2016-12-06 21:42:16 +0100
commit679972f3bef8df7aa04cc99b46f71392ebf0b5f8 (patch)
treeaff2c107d1f2e848a5fbe6288288fbd7c7651e39 /net/bridge
parentd415b9eb76fc55c03ef5451691170aa5771dcea3 (diff)
downloadlinux-679972f3bef8df7aa04cc99b46f71392ebf0b5f8.tar.bz2
netfilter: convert while loops to for loops
This is to facilitate converting from a singly-linked list to an array of elements. Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter_hooks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index adad2eed29e6..b12501a77f18 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -1008,10 +1008,10 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net,
struct nf_hook_state state;
int ret;
- elem = rcu_dereference(net->nf.hooks[NFPROTO_BRIDGE][hook]);
-
- while (elem && (nf_hook_entry_priority(elem) <= NF_BR_PRI_BRNF))
- elem = rcu_dereference(elem->next);
+ for (elem = rcu_dereference(net->nf.hooks[NFPROTO_BRIDGE][hook]);
+ elem && nf_hook_entry_priority(elem) <= NF_BR_PRI_BRNF;
+ elem = rcu_dereference(elem->next))
+ ;
if (!elem)
return okfn(net, sk, skb);