diff mbox series

netfilter: nfnl_hook: fix unused variable warning

Message ID 20210721152245.2751702-1-arnd@kernel.org
State New
Headers show
Series netfilter: nfnl_hook: fix unused variable warning | expand

Commit Message

Arnd Bergmann July 21, 2021, 3:22 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


The only user of this variable is in an #ifdef:

net/netfilter/nfnetlink_hook.c: In function 'nfnl_hook_entries_head':
net/netfilter/nfnetlink_hook.c:177:28: error: unused variable 'netdev' [-Werror=unused-variable]

Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 net/netfilter/nfnetlink_hook.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.29.2

Comments

Pablo Neira Ayuso July 23, 2021, 12:31 p.m. UTC | #1
On Wed, Jul 21, 2021 at 05:22:32PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>

> 

> The only user of this variable is in an #ifdef:

> 

> net/netfilter/nfnetlink_hook.c: In function 'nfnl_hook_entries_head':

> net/netfilter/nfnetlink_hook.c:177:28: error: unused variable 'netdev' [-Werror=unused-variable]


Applied, thanks.
diff mbox series

Patch

diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c
index 50b4e3c9347a..202f57d17bab 100644
--- a/net/netfilter/nfnetlink_hook.c
+++ b/net/netfilter/nfnetlink_hook.c
@@ -174,7 +174,9 @@  static const struct nf_hook_entries *
 nfnl_hook_entries_head(u8 pf, unsigned int hook, struct net *net, const char *dev)
 {
 	const struct nf_hook_entries *hook_head = NULL;
+#ifdef CONFIG_NETFILTER_INGRESS
 	struct net_device *netdev;
+#endif
 
 	switch (pf) {
 	case NFPROTO_IPV4: