Skip to contentSkip to conversation

net: netfilter: Use list_{next/prev}_entry instead of list_entry

PATCH In review simran singhal 2 participants 2 messages Mar 29, 2017 – Apr 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: netfilter: Use list_{next/prev}_entry instead of list_entry

This patch replace list_entry with list_prev_entry as it makes the code more clear to read.

---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
index b7645d7..a341eaf 100644
@@ -1895,7 +1895,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))
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · simran singhal

This patch replace list_entry with list_prev_entry as it makes the code more clear to read.

Also applied, thanks.