All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed
@ 2016-02-02  2:30 Eric Biggers
  2016-02-02  4:19 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2016-02-02  2:30 UTC (permalink / raw)
  To: pablo
  Cc: kaber, kadlec, davem, netfilter-devel, coreteam, netdev,
	linux-kernel, Eric Biggers

This eliminates an "unused function" compiler warning when
CONFIG_NF_CONNTRACK_LABELS is not defined.

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
---
 net/netfilter/nft_ct.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index a0eb216..3cd6b5b 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -31,6 +31,7 @@ struct nft_ct {
 	};
 };
 
+#ifdef CONFIG_NF_CONNTRACK_LABELS
 static u64 nft_ct_get_eval_counter(const struct nf_conn_counter *c,
 				   enum nft_ct_keys k,
 				   enum ip_conntrack_dir d)
@@ -42,6 +43,7 @@ static u64 nft_ct_get_eval_counter(const struct nf_conn_counter *c,
 	return nft_ct_get_eval_counter(c, k, IP_CT_DIR_ORIGINAL) +
 	       nft_ct_get_eval_counter(c, k, IP_CT_DIR_REPLY);
 }
+#endif
 
 static void nft_ct_get_eval(const struct nft_expr *expr,
 			    struct nft_regs *regs,
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed
  2016-02-02  2:30 [PATCH] netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed Eric Biggers
@ 2016-02-02  4:19 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2016-02-02  4:19 UTC (permalink / raw)
  To: Eric Biggers
  Cc: pablo, kaber, kadlec, davem, netfilter-devel, coreteam, netdev,
	linux-kernel

Eric Biggers <ebiggers3@gmail.com> wrote:
> This eliminates an "unused function" compiler warning when
> CONFIG_NF_CONNTRACK_LABELS is not defined.
> 
> Signed-off-by: Eric Biggers <ebiggers3@gmail.com>

The nft_ct_get_eval_counter call should've been unconditional.
The #endif placement is wrong:

https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit?id=efaea94aaf0decd55b15aa7068d4d516a352e56e

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-02  4:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02  2:30 [PATCH] netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed Eric Biggers
2016-02-02  4:19 ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.