net/core/sysctl_net_core.c unused variable
Subsystems (2)
PATCH 1/1 net/core/sysctl_net_core.c unused variable
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.
Nick
Signature · 3 lines
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"
net/core/sysctl_net_core.c renamed from net/core/sysctl_net_core.c.orig +0 -1
@@ -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 ;
Quoted 2 lines · Nick Warne
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.
Quoted 2 lines
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
Quoted 1 line
Signed-off-by Nick Warne <[email protected]>
Please use grep to augment reading.
Quoted 5 lines · Joe Perches
Quoted 2 lines · Nick Warne
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_NETisn't set.
CONFIG_NET=y
Peculiar indeed.
Quoted 10 lines
Quoted 2 lines
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 = &oneQuoted 1 line
Signed-off-by Nick Warne <[email protected]>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
Signature · 3 lines
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"
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Joe Perches
Quoted 25 lines · Nick Warne
Quoted 5 lines · Joe Perches
Quoted 2 lines · Nick Warne
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_NETisn't set.
CONFIG_NET=yPeculiar indeed.
Quoted 10 lines
Quoted 2 lines
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 = &oneQuoted 1 line
Signed-off-by Nick Warne <[email protected]>Please use grep to augment reading.
grep -w -n one
net/core/sysctl_net_core.c
26:static int one = 1;
Quoted 7 lines
Quoted 5 lines
?
I just don't have the &one.
I am confused now.
What source tree are you using?
Latest longterm 3.18.21
Quoted 1 line
What changes in what branch exist?
I am not using git (if that is what you mean by 'branches') - just tarballs from kernel.org
Quoted 5 lines
btw: please use
scripts/get_maintainer.plto 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
Signature · 3 lines
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"
Quoted 29 lines · Nick Warne
Quoted 28 lines · Joe Perches
Quoted 27 lines · Nick Warne
Quoted 5 lines · Joe Perches
Quoted 2 lines · Nick Warne
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_NETisn't set.
CONFIG_NET=yPeculiar indeed.
Quoted 10 lines
Quoted 2 lines
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 = &oneQuoted 1 line
Signed-off-by Nick Warne <[email protected]>Please use grep to augment reading.
grep -w -n one
net/core/sysctl_net_core.c
26:static int one = 1;?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
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.
Quoted 4 lines
Quoted 1 line
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")
Quoted 48 lines · Joe Perches
Quoted 29 lines · Nick Warne
Quoted 28 lines · Joe Perches
Quoted 27 lines · Nick Warne
Quoted 5 lines · Joe Perches
Quoted 2 lines · Nick Warne
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_NETisn't set.
CONFIG_NET=yPeculiar indeed.
Quoted 10 lines
Quoted 2 lines
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 = &oneQuoted 1 line
Signed-off-by Nick Warne <[email protected]>Please use grep to augment reading.
grep -w -n one
net/core/sysctl_net_core.c
26:static int one = 1;?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
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.
Quoted 4 lines
Quoted 1 line
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)
Quoted 7 lines
$ 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.
My patch was right then (but wrong) :)
Thanks Joe,
Nick
Signature · 3 lines
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"