netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
@ 2013-11-16  2:52 Fabio Estevam
  2013-11-16  2:52 ` [PATCH 2/2] net: ipv6: ndisc: " Fabio Estevam
  2013-11-16 18:05 ` [PATCH 1/2] net: ipv6: af_inet6: " Vlad Yasevich
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-11-16  2:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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'.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 net/ipv6/af_inet6.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index ff75313..e4ad65c 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -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)
 {
-- 
1.8.1.2

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

* [PATCH 2/2] net: ipv6: ndisc: Fix warning when CONFIG_SYSCTL=n
  2013-11-16  2:52 [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n Fabio Estevam
@ 2013-11-16  2:52 ` Fabio Estevam
  2013-11-18 19:49   ` David Miller
  2013-11-16 18:05 ` [PATCH 1/2] net: ipv6: af_inet6: " Vlad Yasevich
  1 sibling, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-11-16  2:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 net/ipv6/ndisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f8a55ff..3512177 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -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
-- 
1.8.1.2

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

* Re: [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
  2013-11-16  2:52 [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n Fabio Estevam
  2013-11-16  2:52 ` [PATCH 2/2] net: ipv6: ndisc: " Fabio Estevam
@ 2013-11-16 18:05 ` Vlad Yasevich
  2013-11-16 18:22   ` Vlad Yasevich
  2013-11-16 18:26   ` Hannes Frederic Sowa
  1 sibling, 2 replies; 6+ messages in thread
From: Vlad Yasevich @ 2013-11-16 18:05 UTC (permalink / raw)
  To: Fabio Estevam, davem; +Cc: netdev, Fabio Estevam

On 11/15/2013 09:52 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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'.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  net/ipv6/af_inet6.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index ff75313..e4ad65c 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -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)
>  {
> 

NACK.  ipv6_packet_init and ipv6_packet_cleanup should in no way depend
on sysctl.

-vlad

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

* Re: [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
  2013-11-16 18:05 ` [PATCH 1/2] net: ipv6: af_inet6: " Vlad Yasevich
@ 2013-11-16 18:22   ` Vlad Yasevich
  2013-11-16 18:26   ` Hannes Frederic Sowa
  1 sibling, 0 replies; 6+ messages in thread
From: Vlad Yasevich @ 2013-11-16 18:22 UTC (permalink / raw)
  To: Fabio Estevam, davem; +Cc: netdev, Fabio Estevam

On 11/16/2013 01:05 PM, Vlad Yasevich wrote:
> On 11/15/2013 09:52 PM, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> 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'.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>>  net/ipv6/af_inet6.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
>> index ff75313..e4ad65c 100644
>> --- a/net/ipv6/af_inet6.c
>> +++ b/net/ipv6/af_inet6.c
>> @@ -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)
>>  {
>>
> 
> NACK.  ipv6_packet_init and ipv6_packet_cleanup should 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

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

* Re: [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n
  2013-11-16 18:05 ` [PATCH 1/2] net: ipv6: af_inet6: " Vlad Yasevich
  2013-11-16 18:22   ` Vlad Yasevich
@ 2013-11-16 18:26   ` Hannes Frederic Sowa
  1 sibling, 0 replies; 6+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-16 18:26 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: Fabio Estevam, davem, netdev, Fabio Estevam

On Sat, Nov 16, 2013 at 01:05:22PM -0500, Vlad Yasevich wrote:
> On 11/15/2013 09:52 PM, Fabio Estevam wrote:
> > From: Fabio Estevam <fabio.estevam@freescale.com>
> > 
> > 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'.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> >  net/ipv6/af_inet6.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> > index ff75313..e4ad65c 100644
> > --- a/net/ipv6/af_inet6.c
> > +++ b/net/ipv6/af_inet6.c
> > @@ -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)
> >  {
> > 
> 
> NACK.  ipv6_packet_init and ipv6_packet_cleanup should 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?

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

* Re: [PATCH 2/2] net: ipv6: ndisc: Fix warning when CONFIG_SYSCTL=n
  2013-11-16  2:52 ` [PATCH 2/2] net: ipv6: ndisc: " Fabio Estevam
@ 2013-11-18 19:49   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-11-18 19:49 UTC (permalink / raw)
  To: festevam; +Cc: netdev, fabio.estevam

From: Fabio Estevam <festevam@gmail.com>
Date: Sat, 16 Nov 2013 00:52:08 -0200

> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied.

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

end of thread, other threads:[~2013-11-18 19:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-16  2:52 [PATCH 1/2] net: ipv6: af_inet6: Fix warning when CONFIG_SYSCTL=n Fabio Estevam
2013-11-16  2:52 ` [PATCH 2/2] net: ipv6: ndisc: " Fabio Estevam
2013-11-18 19:49   ` David Miller
2013-11-16 18:05 ` [PATCH 1/2] net: ipv6: af_inet6: " Vlad Yasevich
2013-11-16 18:22   ` Vlad Yasevich
2013-11-16 18:26   ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).