From: Arnd Bergmann <arnd@arndb.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Florian Westphal <fw@strlen.de>,
"David S. Miller" <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@arndb.de>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] netfilter: nat: avoid unused-variable warning
Date: Mon, 25 Mar 2019 14:53:05 +0100 [thread overview]
Message-ID: <20190325135336.2107801-1-arnd@arndb.de> (raw)
masq_refcnt6 was added at the start of the file, but it is
only used in the option IPv6 section of the file, causing
a harmless compiler warning if IPv6 is disabled:
net/netfilter/nf_nat_masquerade.c:15:21: error: 'masq_refcnt6' defined but not used [-Werror=unused-variable]
static unsigned int masq_refcnt6 __read_mostly;
Move the variable next to the user to avoid that warning.
Fixes: 46f7487e161b ("netfilter: nat: don't register device notifier twice")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
This is an older patch stack, for some reason I seem to have never
sent it, and I can't find any indication of anyone else sending
a similar fix, so sending this out now.
If it's already fixed upstream, please ignore.
---
net/netfilter/nf_nat_masquerade.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nf_nat_masquerade.c b/net/netfilter/nf_nat_masquerade.c
index d85c4d902e7b..878a73b4f65c 100644
--- a/net/netfilter/nf_nat_masquerade.c
+++ b/net/netfilter/nf_nat_masquerade.c
@@ -12,7 +12,6 @@
static DEFINE_MUTEX(masq_mutex);
static unsigned int masq_refcnt4 __read_mostly;
-static unsigned int masq_refcnt6 __read_mostly;
unsigned int
nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
@@ -322,6 +321,8 @@ static struct notifier_block masq_inet6_notifier = {
.notifier_call = masq_inet6_event,
};
+static unsigned int masq_refcnt6 __read_mostly;
+
int nf_nat_masquerade_ipv6_register_notifier(void)
{
int ret = 0;
--
2.20.0
next reply other threads:[~2019-03-25 13:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 13:53 Arnd Bergmann [this message]
2019-04-30 12:31 ` [PATCH] netfilter: nat: avoid unused-variable warning Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190325135336.2107801-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).