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 <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
Aaron Conole 2016-11-15 17:48:46 -05:00 • committed by Pablo Neira Ayuso
commit 679972f3be
2 changed files with 6 additions and 8 deletions

View file

@ -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);