Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3258950img; Mon, 25 Mar 2019 06:56:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRQx2g3cCfUFN0yaeJW/deq6ZSjGZnq59XFci92IA9s4OAMCGkBpuu6ZKz7JuuihitJvWq X-Received: by 2002:a17:902:361:: with SMTP id 88mr25646666pld.78.1553522170364; Mon, 25 Mar 2019 06:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553522170; cv=none; d=google.com; s=arc-20160816; b=LrYx8BG1Js5laYy2kDrkFZ6QXFE79cl4G/lNEU2xnble/wg04DMijiOETnpJyQ7b8C TDekPrZ4OWXUcNlbBcQv2qokh1CL0TE2YJJJEo885RJn1CfWO4LETS+BIfQXYPqwOsvg diH+izAG8seDhbI4Ps5Ouxp0F19hCqtcZpLyxV91wyjtHUOotFam9K3vPKVK8cWLkbjz JGypkVsX7B9NJEddbvR9TMQA05h1SpvGHEtmBtRrySdJuEgznUZSKLmkcfr1w6pG3KGY jS2tCnQaOk4f1Gz5RXqsgrVIvfX8rX9TXSX6YzLleuV9ElqAh8xYG/PjsqzPm4R2om2s eVKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aEPVKk6+cUagitaHNbRhXCSCVT1K1k0BPWEfpbRhPHI=; b=Pps/qKr/e+j9b6bg+xRYu+TPiIh+cSFJ55ImWVCMUv2wTaksHvm7YFBPnc9nAAbGbE HUtI07xuRpCJpUdorvfgayu+jj7/mRPLMQRNNUL76BGGycRVk8t1ietw1FNVBY5Qgt7H Vhb748amvubKT9UI4ouT6aTR0Ia4j6/YX3Djz+GFmxtclGN1Dw8N5s289SpTKiOkZFNc kri53A2toRB632ieDd0Nd10OFz0Pa239uIKA6MnHw/QfyjIHPcD0DfKdxH7p/6psxbve gC0i0uc0qyd2TRDkXigJZecNcINyHd7S1Qd6XJGDaDOK6VJmb1wAl5VpSQqOYP8kOtQp mGJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si13256638pgp.564.2019.03.25.06.55.55; Mon, 25 Mar 2019 06:56:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729257AbfCYNxz (ORCPT + 99 others); Mon, 25 Mar 2019 09:53:55 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:59045 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbfCYNxz (ORCPT ); Mon, 25 Mar 2019 09:53:55 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1Ml76o-1ggnzL0AV2-00lXoq; Mon, 25 Mar 2019 14:53:39 +0100 From: Arnd Bergmann To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" Cc: Arnd Bergmann , 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 Message-Id: <20190325135336.2107801-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:CGJ0DOJ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@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ---- 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