Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_tables: remove nft_dereference()

This macro is unnecessary, it just hides details for one single caller.
nfnl_dereference() is just enough.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

+3 -6
-3
include/net/netfilter/nf_tables.h
··· 1113 1113 1114 1114 void nft_trace_notify(struct nft_traceinfo *info); 1115 1115 1116 - #define nft_dereference(p) \ 1117 - nfnl_dereference(p, NFNL_SUBSYS_NFTABLES) 1118 - 1119 1116 #define MODULE_ALIAS_NFT_FAMILY(family) \ 1120 1117 MODULE_ALIAS("nft-afinfo-" __stringify(family)) 1121 1118
+3 -3
net/netfilter/nf_tables_api.c
··· 1222 1222 static void nft_chain_stats_replace(struct nft_base_chain *chain, 1223 1223 struct nft_stats __percpu *newstats) 1224 1224 { 1225 + struct nft_stats __percpu *oldstats; 1226 + 1225 1227 if (newstats == NULL) 1226 1228 return; 1227 1229 1228 1230 if (chain->stats) { 1229 - struct nft_stats __percpu *oldstats = 1230 - nft_dereference(chain->stats); 1231 - 1231 + oldstats = nfnl_dereference(chain->stats, NFNL_SUBSYS_NFTABLES); 1232 1232 rcu_assign_pointer(chain->stats, newstats); 1233 1233 synchronize_rcu(); 1234 1234 free_percpu(oldstats);