net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
Subsystems (3)
PATCH 1/2 net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
From: Fabio Estevam <[email protected]>
When CONFIG_SYSCTL=n the following build warning happens:
net/ipv6/af_inet6.c:710:13: warning: 'ipv6_packet_cleanup' defined but not used [-Wunused-function]
ipv6_packet_cleanup() is only used when CONFIG_SYSCTL=y, so protect its definition with an'ifdef CONFIG_SYSCTL'.
--- net/ipv6/af_inet6.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv6/af_inet6.c +2 -0
@@ -707,10 +707,12 @@ static int __init ipv6_packet_init(void)return 0 ; } +#ifdef CONFIG_SYSCTL static void ipv6_packet_cleanup (void ) {dev_remove_pack (&ipv6_packet_type); } +#endif static int __net_init ipv6_init_mibs (struct net *net) {
Signature · 1 line
1.8.1.2
PATCH 2/2 net: ipv6: ndisc: Fix warning when CONFIG_SYSCTL=n
From: Fabio Estevam <[email protected]>
When CONFIG_SYSCTL=n the following build warning happens:
net/ipv6/ndisc.c:1730:1: warning: label 'out' defined but not used [-Wunused-label]
The 'out' label is only used when CONFIG_SYSCTL=y, so move it inside the 'ifdef CONFIG_SYSCTL' block.
--- net/ipv6/ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ndisc.c +1 -1
@@ -1726,8 +1726,8 @@ int __init ndisc_init(void) &ndisc_ifinfo_sysctl_change);if (err) goto out_unregister_pernet; -#endif out: +#endif return err;#ifdef CONFIG_SYSCTL
Signature · 1 line
1.8.1.2
Re: [PATCH 2/2] net: ipv6: ndisc: Fix warning when CONFIG_SYSCTL=n
From: Fabio Estevam <[email protected]>
Date: Sat, 16 Nov 2013 00:52:08 -0200
Quoted 10 lines
From: Fabio Estevam <[email protected]>
When
CONFIG_SYSCTL=nthe following build warning happens:
net/ipv6/ndisc.c:1730:1: warning: label 'out' defined but not used [-Wunused-label]The 'out' label is only used when
CONFIG_SYSCTL=y, so move it inside the 'ifdefCONFIG_SYSCTL' block.Signed-off-by Fabio Estevam <[email protected]>
Applied.
Quoted 22 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
When
CONFIG_SYSCTL=nthe following build warning happens:
net/ipv6/af_inet6.c:710:13: warning: 'ipv6_packet_cleanup' defined but not used [-Wunused-function]
ipv6_packet_cleanup()is only used whenCONFIG_SYSCTL=y, so protect its definition with an'ifdefCONFIG_SYSCTL'.Signed-off-by Fabio Estevam <[email protected]>--- net/ipv6/af_inet6.c | 2 ++ 1 file changed, 2 insertions(+)net/ipv6/af_inet6.c +0
-0@@ -707,10 +707,12 @@ static int __init ipv6_packet_init(void)return 0 ; }
net/ipv6/af_inet6.c static int __init ipv6_packet_init(void) · line 718
Quoted 10 lines
net/ipv6/af_inet6.c +2
-0+#ifdef CONFIG_SYSCTL static void ipv6_packet_cleanup (void ) {dev_remove_pack (&ipv6_packet_type); } +#endif static int __net_init ipv6_init_mibs (struct net *net) {
NACK. ipv6_packet_init and ipv6_packet_cleanup should in no way depend on sysctl.
-vlad
Quoted 30 lines · Vlad Yasevich
Quoted 29 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
When
CONFIG_SYSCTL=nthe following build warning happens:
net/ipv6/af_inet6.c:710:13: warning: 'ipv6_packet_cleanup' defined but not used [-Wunused-function]
ipv6_packet_cleanup()is only used whenCONFIG_SYSCTL=y, so protect its definition with an'ifdefCONFIG_SYSCTL'.Signed-off-by Fabio Estevam <[email protected]>--- net/ipv6/af_inet6.c | 2 ++ 1 file changed, 2 insertions(+)net/ipv6/af_inet6.c +2
-0@@ -707,10 +707,12 @@ static int __init ipv6_packet_init(void)return 0 ; } +#ifdef CONFIG_SYSCTL static void ipv6_packet_cleanup (void ) {dev_remove_pack (&ipv6_packet_type); } +#endif
Quoted 9 lines
net/ipv6/af_inet6.c static int __init ipv6_packet_init(void) · line 718
Quoted 3 lines
net/ipv6/af_inet6.c +0
-0static int __net_init ipv6_init_mibs (struct net *net) {NACK.
ipv6_packet_initandipv6_packet_cleanupshould in no way depend on sysctl.-vlad
It actually appears a bit worse then that. Looks like the inet6_init() error were a bit messed up after the introduction of ping socket support.
-vlad
Quoted 30 lines · Vlad Yasevich
Quoted 29 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
When
CONFIG_SYSCTL=nthe following build warning happens:
net/ipv6/af_inet6.c:710:13: warning: 'ipv6_packet_cleanup' defined but not used [-Wunused-function]
ipv6_packet_cleanup()is only used whenCONFIG_SYSCTL=y, so protect its definition with an'ifdefCONFIG_SYSCTL'.Signed-off-by Fabio Estevam <[email protected]>--- net/ipv6/af_inet6.c | 2 ++ 1 file changed, 2 insertions(+)net/ipv6/af_inet6.c +2
-0@@ -707,10 +707,12 @@ static int __init ipv6_packet_init(void)return 0 ; } +#ifdef CONFIG_SYSCTL static void ipv6_packet_cleanup (void ) {dev_remove_pack (&ipv6_packet_type); } +#endif
Quoted 6 lines
net/ipv6/af_inet6.c static int __init ipv6_packet_init(void) · line 718
Quoted 3 lines
net/ipv6/af_inet6.c +0
-0static int __net_init ipv6_init_mibs (struct net *net) {NACK.
ipv6_packet_initandipv6_packet_cleanupshould in no way depend on sysctl.
It is only used in an error path if CONFIG_SYSCTL=y. I agree it does look a bit odd.
Maybe just add __maybe_unused to ipv6_packet_cleanup?