From patchwork Mon Mar 25 13:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 161112 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3999760jan; Mon, 25 Mar 2019 06:53:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcgUt4zu4jXCtw7tWiJKRzDyHGgIlzYpeJsYlLd6ZPeqRqjFdsYYSfLddiBP7qh0ogcILC X-Received: by 2002:a65:5003:: with SMTP id f3mr10759008pgo.29.1553522037318; Mon, 25 Mar 2019 06:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553522037; cv=none; d=google.com; s=arc-20160816; b=YepaPZ5jOBjR0YlSEl0tUgMwXeBl8frbaxS4F/6RLVIbiaYH0fh7j/0gcJLDw2zQvh WjKT0ypW8W7dN3zCubUqW2D8jjNrOoLz1AOz7ni3F0c1/Tm3/Da2NyxF8KTqz/+z+ty0 rsvA5uDAJkkssfh3vFVm2mDEy0bV2g1LmGK6xAHvvAzYkDeiISFOLhm6aV9bDxJE6Zh2 ils8PSs/q1hK01eHe8OazfHl+6/cXss87Qwl0rB+dKftxuUNPNDH0o8eSbgLWlw85eMU seIvIHrhAmfpfS1bJOLo+5oUeN93YJCERb3FjaXjdLCBekZNpgibnynnrUb+BKWckYhZ 6hGw== 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 y29si7489037pgk.120.2019.03.25.06.53.57; Mon, 25 Mar 2019 06:53:57 -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 S1729264AbfCYNxz (ORCPT + 31 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 X-Provags-ID: V03:K1:CGJ0DOJHsCwmbLDcOAlalRstVPVwDxhUsFCatOpujVLgwDkeK2v Tot09vijRNlCuZvLQ3bwqjKoLejfq+f4RwK7e6GdTOPLH5DJ/ORLCrYDoJz+90+DshdTbaF /EXmLVJuIqL+tRAyZtncx9b0OMAR6bzScGwimnjcXDNafZgOGDQGyfYXJwRvjtFcotiX0UM ONZmrp5t7GuVs+x6utpbQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:ql8aJH6eo+c=:+QYhOVLgoGQ4+J6Dp2PaqJ lLiyQJ3CEA2OY8WNLEPyo7yOVTq1PKtbuCzUdInyEBF49Y0L6MILrHSgGpsqUM7PSZL9LIlkI R2SeitHC59sl4aLUGgXr3Zc6oJxp6A7xelbr2UGbUt1j7HLaNbtUoxGu5CMtUHQ85ckyr0dbp 6oOpBLA+5pPXGCkf4h7HC7bNrfeI1wIj5VAaA3zkyvknakodyHrCBe07cIFwoaHAzhQnIYkvC 1yucP/jcfrQz9d4I+lkS/m759ZrJhlv5dZJWP90llHm1SjfwIPDse1SCq9iiuhpzPUnYpsYT/ fDjTm9KA47ASvf1SKnQPSdk+NEXOIBpqsHn8QbUPm6MaMxkLwIGnirNakX5oOBx86RKvJRHDI nPLkAH5A1CAJcWsg0vLAJP6h1ICal0R8/YS/uEH7TZUQf3Rj69tHWmudl615Wrxf+vxa1yyMr 4lVLjKmr4rRHMa4uqDl5+aKST315S4EogaDRKquD3W7JIDCony/pvvZKiKKqRUBgg8vpJUzCJ dt823DqAjLbchvg4x5qbh8zfVHWf28OVGGAnrBl6wMwhvDpzvao53+bT8TcuQ4djRjTs3sj6c k88WX5vBXOEzrfTBHuZRZkpdP5E5ZTW5hAWJ9wn9IxsfqZ1iSJPKSKfQpncsg//dDezPpGL9p 91Jx3VSdE0JL+8oqy8n1zxrsyrats0jnf9iBpoe/6uuId9vxAM4tJuNhws4bW5XRK3Ln5jwvD lpMiOnqYw3cLTWrOyJfgzWnUPxSUQrrITc6/nA== Sender: linux-kernel-owner@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(-) -- 2.20.0 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;