public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/core/sysctl_net_core.c  unused variable
@ 2015-09-06 14:13 Nick Warne
  2015-09-06 14:52 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Warne @ 2015-09-06 14:13 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

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.  Reading the file, that is 
the case.  Attached is a patch to remove it.

Signed-off-by:  Nick Warne <nick@linicks.net>

Nick
-- 
Gosh that takes me back... or is it forward?  That's the trouble with
time travel, you never can tell."
		-- Doctor Who "Androids of Tara"

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 378 bytes --]

--- linux-3.18.21/net/core/sysctl_net_core.c.orig	2015-09-06 15:03:05.066306670 +0100
+++ linux-3.18.21/net/core/sysctl_net_core.c	2015-09-06 15:03:14.501034348 +0100
@@ -23,7 +23,6 @@
 #include <net/pkt_sched.h>
 
 static int zero = 0;
-static int one = 1;
 static int ushort_max = USHRT_MAX;
 static int min_sndbuf = SOCK_MIN_SNDBUF;
 static int min_rcvbuf = SOCK_MIN_RCVBUF;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/core/sysctl_net_core.c  unused variable
  2015-09-06 14:13 [PATCH] net/core/sysctl_net_core.c unused variable Nick Warne
@ 2015-09-06 14:52 ` Joe Perches
  2015-09-06 15:16   ` Nick Warne
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2015-09-06 14:52 UTC (permalink / raw)
  To: Nick Warne; +Cc: linux-kernel

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.

> 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 <nick@linicks.net>

Please use grep to augment reading.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/core/sysctl_net_core.c  unused variable
  2015-09-06 14:52 ` Joe Perches
@ 2015-09-06 15:16   ` Nick Warne
       [not found]     ` <1441553310.28194.44.camel@perches.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Warne @ 2015-09-06 15:16 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel

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 <nick@linicks.net>
>
> 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.

Nick
-- 
Gosh that takes me back... or is it forward?  That's the trouble with
time travel, you never can tell."
		-- Doctor Who "Androids of Tara"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/core/sysctl_net_core.c  unused variable
       [not found]     ` <1441553310.28194.44.camel@perches.com>
@ 2015-09-06 15:36       ` Nick Warne
  2015-09-06 15:51         ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Warne @ 2015-09-06 15:36 UTC (permalink / raw)
  To: Joe Perches, linux-kernel, netdev

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 <nick@linicks.net>
>> >
>> > 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

> What changes in what branch exist?

I am not using git (if that is what you mean by 'branches') - just 
tarballs from kernel.org
>
> btw: please use scripts/get_maintainer.pl to better
> determine who should be cc'd on your patches.
>
> you left out netdev.

Sorry, my bad, I need to learn/read more.

Thanks for your help/advice :)

Nick
-- 
Gosh that takes me back... or is it forward?  That's the trouble with
time travel, you never can tell."
		-- Doctor Who "Androids of Tara"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/core/sysctl_net_core.c  unused variable
  2015-09-06 15:36       ` Nick Warne
@ 2015-09-06 15:51         ` Joe Perches
  2015-09-06 16:08           ` Nick Warne
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2015-09-06 15:51 UTC (permalink / raw)
  To: Nick Warne; +Cc: linux-kernel, netdev, Alexey Kodanev

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 <nick@linicks.net>
> >> >
> >> > 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")




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net/core/sysctl_net_core.c  unused variable
  2015-09-06 15:51         ` Joe Perches
@ 2015-09-06 16:08           ` Nick Warne
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Warne @ 2015-09-06 16:08 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, netdev, Alexey Kodanev



On 06/09/15 16:51, Joe Perches wrote:
> 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 <nick@linicks.net>
>> >> >
>> >> > 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")

Ah, OK. GCC was right - just the variable declaration was overlooked to 
be removed too.

http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=c48cf4f27d4555a455c3fef71137bd0fc44d1656

My patch was right then (but wrong) :)

Thanks Joe,

Nick

-- 
Gosh that takes me back... or is it forward?  That's the trouble with
time travel, you never can tell."
		-- Doctor Who "Androids of Tara"

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-06 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-06 14:13 [PATCH] net/core/sysctl_net_core.c unused variable Nick Warne
2015-09-06 14:52 ` Joe Perches
2015-09-06 15:16   ` Nick Warne
     [not found]     ` <1441553310.28194.44.camel@perches.com>
2015-09-06 15:36       ` Nick Warne
2015-09-06 15:51         ` Joe Perches
2015-09-06 16:08           ` Nick Warne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox