From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752600AbbIFPwH (ORCPT ); Sun, 6 Sep 2015 11:52:07 -0400 Received: from smtprelay0081.hostedemail.com ([216.40.44.81]:59125 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752410AbbIFPv5 (ORCPT ); Sun, 6 Sep 2015 11:51:57 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3873:3874:4250:4321:4605:4641:5007:6119:6261:7875:7903:10004:10394:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12555:12663:12740:13019:13069:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: day27_681dab1bc3624 X-Filterd-Recvd-Size: 2636 Message-ID: <1441554714.28194.49.camel@perches.com> Subject: Re: [PATCH] net/core/sysctl_net_core.c unused variable From: Joe Perches To: Nick Warne Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Alexey Kodanev Date: Sun, 06 Sep 2015 08:51:54 -0700 In-Reply-To: <55EC5D6B.3030402@linicks.net> References: <55EC4A03.905@linicks.net> <1441551148.28194.40.camel@perches.com> <55EC58DF.6020501@linicks.net> <1441553310.28194.44.camel@perches.com> <55EC5D6B.3030402@linicks.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2015-09-06 at 16:36 +0100, Nick Warne wrote: > On 06/09/15 16:28, Joe Perches wrote: > > On Sun, 2015-09-06 at 16:16 +0100, Nick Warne wrote: > >> On 06/09/15 15:52, Joe Perches wrote: > >> > On Sun, 2015-09-06 at 15:13 +0100, Nick Warne wrote: > >> >> gcc version 4.8.2 (GCC) warns that 'static int one = 1;' is declared but > >> >> not used in file net/core/sysctl_net_core.c. > >> > > >> > Only when CONFIG_NET isn't set. > >> > >> CONFIG_NET=y > >> > >> Peculiar indeed. > >> > >> >> Reading the file, that is > >> >> the case. Attached is a patch to remove it. > >> > > >> > $ git grep -w -n one net/core/sysctl_net_core.c > >> > net/core/sysctl_net_core.c:26:static int one = 1; > >> > net/core/sysctl_net_core.c:332: .extra2 = &one > >> > > >> >> Signed-off-by: Nick Warne > >> > > >> > Please use grep to augment reading. > >> > >> grep -w -n one net/core/sysctl_net_core.c > >> 26:static int one = 1; > >> > >> ? > >> > >> I just don't have the &one. > >> > >> I am confused now. > > > > What source tree are you using? > > Latest longterm 3.18.21 OK, it's important to mention that otherwise the assumption would be a git tree like net or net-next. > > What changes in what branch exist? > > I am not using git (if that is what you mean by 'branches') - just > tarballs from kernel.org (OK, using git and linux-stable) $ git grep -w -n one v3.18.21 -- net/core/sysctl_net_core.c v3.18.21:net/core/sysctl_net_core.c:26:static int one = 1; And the responsible commit: commit c48cf4f27d4555a455c3fef71137bd0fc44d1656 ("net: sysctl_net_core: check SNDBUF and RCVBUF for min length")