netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused
Subsystems (3)
PATCH 1/1 netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused
The newly added nft_ct_get_eval_counter() function is only used when CONFIG_NF_CONNTRACK_LABELS is set, otherwise gcc warns about the unused definition:
netfilter/nft_ct.c:34:12: warning: 'nft_ct_get_eval_counter' defined but not used [-Wunused-function]
static u64 nft_ct_get_eval_counter(const struct nf_conn_counter *c,
This marks the function __maybe_unused to shut up the warning.
---
Found on ARM randconfig builds this week
net/netfilter/nft_ct.c +3 -3
@@ -31,9 +31,9 @@ struct nft_ct { }; }; -static u64 nft_ct_get_eval_counter (const struct nf_conn_counter *c, -enum nft_ct_keys k, -enum ip_conntrack_dir d) +static u64 __maybe_unused nft_ct_get_eval_counter (const struct nf_conn_counter *c, +enum nft_ct_keys k, +enum ip_conntrack_dir d) {if (d <IP_CT_DIR_MAX ) return k == NFT_CT_BYTES ? atomic64_read(&c[d].bytes) :
Pablo Neira Ayuso
maintainerQuoted 8 lines · Arnd Bergmann
The newly added
nft_ct_get_eval_counter()function is only used whenCONFIG_NF_CONNTRACK_LABELSis set, otherwise gcc warns about the unused definition:
netfilter/nft_ct.c:34:12: warning: 'nft_ct_get_eval_counter' defined but not used [-Wunused-function]
static u64 nft_ct_get_eval_counter(const structnf_conn_counter*c,This marks the function
__maybe_unusedto shut up the warning.
It seems that function doesn't below to CONFIG_NF_CONNTRACK_LABELS as it is part of the new counter support. Will be sending an alternate patch instead.
Thanks anyway for your patch Arnd.
Pablo Neira Ayuso
maintainerQuoted 5 lines · Pablo Neira Ayuso
Quoted 4 lines · Arnd Bergmann
The newly added
nft_ct_get_eval_counter()function is only used whenCONFIG_NF_CONNTRACK_LABELSis set, otherwise gcc warns about the unused definition:
Quoted 8 lines
Quoted 4 lines
netfilter/nft_ct.c:34:12: warning: 'nft_ct_get_eval_counter' defined but not used [-Wunused-function]
static u64 nft_ct_get_eval_counter(const structnf_conn_counter*c,This marks the function
__maybe_unusedto shut up the warning.It seems that function doesn't below to
CONFIG_NF_CONNTRACK_LABELSas it is part of the new counter support. Will be sending an alternate patch instead.
Just for the record, I submitted this fix: