Skip to content

Commit 0befd06

Browse files
committed
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 <[email protected]>
1 parent a7f87b4 commit 0befd06

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

include/net/netfilter/nf_tables.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,6 @@ void nft_trace_init(struct nft_traceinfo *info, const struct nft_pktinfo *pkt,
11131113

11141114
void nft_trace_notify(struct nft_traceinfo *info);
11151115

1116-
#define nft_dereference(p) \
1117-
nfnl_dereference(p, NFNL_SUBSYS_NFTABLES)
1118-
11191116
#define MODULE_ALIAS_NFT_FAMILY(family) \
11201117
MODULE_ALIAS("nft-afinfo-" __stringify(family))
11211118

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,13 +1222,13 @@ static struct nft_stats __percpu *nft_stats_alloc(const struct nlattr *attr)
12221222
static void nft_chain_stats_replace(struct nft_base_chain *chain,
12231223
struct nft_stats __percpu *newstats)
12241224
{
1225+
struct nft_stats __percpu *oldstats;
1226+
12251227
if (newstats == NULL)
12261228
return;
12271229

12281230
if (chain->stats) {
1229-
struct nft_stats __percpu *oldstats =
1230-
nft_dereference(chain->stats);
1231-
1231+
oldstats = nfnl_dereference(chain->stats, NFNL_SUBSYS_NFTABLES);
12321232
rcu_assign_pointer(chain->stats, newstats);
12331233
synchronize_rcu();
12341234
free_percpu(oldstats);

0 commit comments

Comments
 (0)