Skip to content

Commit

Permalink
net: netfilter: Use list_{next/prev}_entry instead of list_entry
Browse files Browse the repository at this point in the history
This patch replace list_entry with list_prev_entry as it makes the
code more clear to read.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
simran singhal authored and Pablo Neira Ayuso committed Apr 7, 2017
1 parent cdec268 commit cbbb40e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
@@ -1905,7 +1905,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net,
goto nla_put_failure;

if ((event != NFT_MSG_DELRULE) && (rule->list.prev != &chain->rules)) {
prule = list_entry(rule->list.prev, struct nft_rule, list);
prule = list_prev_entry(rule, list);
if (nla_put_be64(skb, NFTA_RULE_POSITION,
cpu_to_be64(prule->handle),
NFTA_RULE_PAD))

0 comments on commit cbbb40e

Please sign in to comment.