Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1308437 > unrolled thread

[PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused

Started byArnd Bergmann <arnd@arndb.de>
First post2016-01-13 15:10 +0100
Last post2016-01-13 17:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2016-01-13 15:10 +0100
    Re: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter  __maybe_unused Pablo Neira Ayuso <pablo@netfilter.org> - 2016-01-13 17:00 +0100
      Re: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter  __maybe_unused Pablo Neira Ayuso <pablo@netfilter.org> - 2016-01-13 17:50 +0100

#1308437 — [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused

FromArnd Bergmann <arnd@arndb.de>
Date2016-01-13 15:10 +0100
Subject[PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused
Message-ID<qQuhA-Oj-23@gated-at.bofh.it>
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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 48f66c905a97 ("netfilter: nft_ct: add byte/packet counter support")
---
Found on ARM randconfig builds this week

diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index a0eb2161e3ef..3496929bbc54 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -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) :

[toc] | [next] | [standalone]


#1308536 — Re: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2016-01-13 17:00 +0100
SubjectRe: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused
Message-ID<qQw02-1PH-15@gated-at.bofh.it>
In reply to#1308437
On Wed, Jan 13, 2016 at 02:58:11PM +0100, Arnd Bergmann wrote:
> 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.

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.

[toc] | [prev] | [next] | [standalone]


#1308591 — Re: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2016-01-13 17:50 +0100
SubjectRe: [PATCH] netfilter: nft_ct: mark nft_ct_get_eval_counter __maybe_unused
Message-ID<qQwMq-2sp-5@gated-at.bofh.it>
In reply to#1308536
On Wed, Jan 13, 2016 at 04:54:24PM +0100, Pablo Neira Ayuso wrote:
> On Wed, Jan 13, 2016 at 02:58:11PM +0100, Arnd Bergmann wrote:
> > 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.
> 
> 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.

Just for the record, I submitted this fix:

http://patchwork.ozlabs.org/patch/567063/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web