All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa/slave: Fix compilation warnings
@ 2012-10-29 16:57 Viresh Kumar
  2012-10-29 19:59 ` Ben Hutchings
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-29 16:57 UTC (permalink / raw)
  To: davem; +Cc: linaro-dev, patches, netdev, linux-kernel, Viresh Kumar

Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:

net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used [-Wunused-function]
net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used [-Wunused-function]
net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used [-Wunused-function]
net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined but not used [-Wunused-function]
net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but not used [-Wunused-function]
net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined but not used [-Wunused-function]
net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not used [-Wunused-function]

Fix them by enclosing these routines under #ifdef,endif.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 net/dsa/slave.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e32083d..5606fae 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -48,6 +48,8 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
 
 
 /* slave device handling ****************************************************/
+#if defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA) || \
+		defined(CONFIG_NET_DSA_TAG_TRAILER)
 static int dsa_slave_init(struct net_device *dev)
 {
 	struct dsa_slave_priv *p = netdev_priv(dev);
@@ -170,6 +172,8 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 
 	return -EOPNOTSUPP;
 }
+#endif /* defined(CONFIG_NET_DSA_TAG_DSA) || defined(CONFIG_NET_DSA_TAG_EDSA ||
+		defined(CONFIG_NET_DSA_TAG_TRAILER) */
 
 
 /* ethtool operations *******************************************************/
-- 
1.7.12.rc2.18.g61b472e


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-29 16:57 [PATCH] net: dsa/slave: Fix compilation warnings Viresh Kumar
@ 2012-10-29 19:59 ` Ben Hutchings
  2012-10-30  6:45   ` Viresh Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Hutchings @ 2012-10-29 19:59 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: davem, linaro-dev, patches, netdev, linux-kernel

On Mon, 2012-10-29 at 22:27 +0530, Viresh Kumar wrote:
> Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
> CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:
> 
> net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used [-Wunused-function]
> net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used [-Wunused-function]
> net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used [-Wunused-function]
> net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined but not used [-Wunused-function]
> net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but not used [-Wunused-function]
> net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined but not used [-Wunused-function]
> net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not used [-Wunused-function]
> 
> Fix them by enclosing these routines under #ifdef,endif.
[...]

This is not a useful configuration.  It might make more sense to make
NET_DSA a hidden option and have the DSA drivers (in drivers/net/dsa)
select it rather than depending on it.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-29 19:59 ` Ben Hutchings
@ 2012-10-30  6:45   ` Viresh Kumar
  2012-10-30  7:31     ` Viresh Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-30  6:45 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: davem, linaro-dev, patches, netdev, linux-kernel

On 30 October 2012 01:29, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Mon, 2012-10-29 at 22:27 +0530, Viresh Kumar wrote:
>> Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
>> CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:
>>
>> net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used [-Wunused-function]
>> net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used [-Wunused-function]
>> net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used [-Wunused-function]
>> net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined but not used [-Wunused-function]
>> net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but not used [-Wunused-function]
>> net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined but not used [-Wunused-function]
>> net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not used [-Wunused-function]
>>
>> Fix them by enclosing these routines under #ifdef,endif.
> [...]
>
> This is not a useful configuration.  It might make more sense to make
> NET_DSA a hidden option and have the DSA drivers (in drivers/net/dsa)
> select it rather than depending on it.

I don't have any idea about net/dsa/***. I just wanted to fix this
awkward looking warning :)
What i understood from your comment is: Atleast one of the tagging
formats must be
always enabled if we want to use net/dsa/ stuff ??

And so the functions i have enclosed under ifdefs will always be used
if net/dsa/ is
used.

And so, if we select NET_DSA from these tagging drivers, then only slave.c will
get compiled. Otherwise slave.c dsa.c dsa_core.c wouldn't be compiled and so
no warnings.

Correct??

--
viresh

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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  6:45   ` Viresh Kumar
@ 2012-10-30  7:31     ` Viresh Kumar
  2012-10-30  7:53       ` Daniel Lezcano
       [not found]       ` <CAKohponOKk5e2Sxyhjw-XvzVxF3tNp66rsnYCwvwHazAPAauKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Viresh Kumar @ 2012-10-30  7:31 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: davem, linaro-dev, patches, netdev, linux-kernel

On 30 October 2012 12:15, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> And so, if we select NET_DSA from these tagging drivers, then only slave.c will
> get compiled. Otherwise slave.c dsa.c dsa_core.c wouldn't be compiled and so
> no warnings.

If my above explanation/assumption is correct, then please review following
patch:

--------------------------x-----------------------x----------------

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Mon, 29 Oct 2012 22:19:14 +0530
Subject: [PATCH] net: dsa/slave: Fix compilation warnings

Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:

net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used
[-Wunused-function]
net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used
[-Wunused-function]
net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used
[-Wunused-function]
net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined
but not used [-Wunused-function]
net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but
not used [-Wunused-function]
net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined
but not used [-Wunused-function]
net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not
used [-Wunused-function]

Earlier approach to fix this was discussed here:

lkml.org/lkml/2012/10/29/549

This is another approach to fix it. This is done by some changes in config
options, which make more sense than the earlier approach. As, atleast one
tagging option must always be selected for using net/dsa/ infrastructure, this
patch selects NET_DSA from tagging configs instead of having it as an selectable
config.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/net/dsa/Kconfig |  1 -
 net/dsa/Kconfig         | 16 +++++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index dd151d5..96eae22 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -1,5 +1,4 @@
 menu "Distributed Switch Architecture drivers"
-	depends on NET_DSA

 config NET_DSA_MV88E6XXX
 	tristate
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index 274791c..f7c6cef 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -1,5 +1,5 @@
 config NET_DSA
-	tristate "Distributed Switch Architecture support"
+	tristate
 	default n
 	depends on EXPERIMENTAL && NETDEVICES && !S390
 	select PHYLIB
@@ -8,19 +8,21 @@ config NET_DSA
 	  the Distributed Switch Architecture.


-if NET_DSA
+menu "Distributed Switch Architecture support"

 # tagging formats
 config NET_DSA_TAG_DSA
-	bool
+	bool "Original DSA packet tagging format"
+	select NET_DSt
 	default n

 config NET_DSA_TAG_EDSA
-	bool
+	bool "Ethertype DSA packet tagging format"
+	select NET_DSA
 	default n

 config NET_DSA_TAG_TRAILER
-	bool
+	bool "Trailer DSA packet tagging format"
+	select NET_DSA
 	default n
-
-endif
+endmenu

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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  7:31     ` Viresh Kumar
@ 2012-10-30  7:53       ` Daniel Lezcano
  2012-10-30  7:55         ` Viresh Kumar
       [not found]       ` <CAKohponOKk5e2Sxyhjw-XvzVxF3tNp66rsnYCwvwHazAPAauKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Lezcano @ 2012-10-30  7:53 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 10/30/2012 08:31 AM, Viresh Kumar wrote:
> On 30 October 2012 12:15, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>> And so, if we select NET_DSA from these tagging drivers, then only slave.c will
>> get compiled. Otherwise slave.c dsa.c dsa_core.c wouldn't be compiled and so
>> no warnings.
> 
> If my above explanation/assumption is correct, then please review following
> patch:
> 
> --------------------------x-----------------------x----------------
> 
> From: Viresh Kumar <viresh.kumar@linaro.org>
> Date: Mon, 29 Oct 2012 22:19:14 +0530
> Subject: [PATCH] net: dsa/slave: Fix compilation warnings
> 
> Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
> CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation warnings:
> 
> net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined
> but not used [-Wunused-function]
> net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but
> not used [-Wunused-function]
> net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined
> but not used [-Wunused-function]
> net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not
> used [-Wunused-function]
> 
> Earlier approach to fix this was discussed here:
> 
> lkml.org/lkml/2012/10/29/549
> 
> This is another approach to fix it. This is done by some changes in config
> options, which make more sense than the earlier approach. As, atleast one
> tagging option must always be selected for using net/dsa/ infrastructure, this
> patch selects NET_DSA from tagging configs instead of having it as an selectable
> config.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/net/dsa/Kconfig |  1 -
>  net/dsa/Kconfig         | 16 +++++++++-------
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
> index dd151d5..96eae22 100644
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -1,5 +1,4 @@
>  menu "Distributed Switch Architecture drivers"
> -	depends on NET_DSA
> 
>  config NET_DSA_MV88E6XXX
>  	tristate
> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
> index 274791c..f7c6cef 100644
> --- a/net/dsa/Kconfig
> +++ b/net/dsa/Kconfig
> @@ -1,5 +1,5 @@
>  config NET_DSA
> -	tristate "Distributed Switch Architecture support"
> +	tristate
>  	default n
>  	depends on EXPERIMENTAL && NETDEVICES && !S390
>  	select PHYLIB
> @@ -8,19 +8,21 @@ config NET_DSA
>  	  the Distributed Switch Architecture.
> 
> 
> -if NET_DSA
> +menu "Distributed Switch Architecture support"
> 
>  # tagging formats
>  config NET_DSA_TAG_DSA
> -	bool
> +	bool "Original DSA packet tagging format"
> +	select NET_DSt

typo NET_DSA

>  	default n
> 
>  config NET_DSA_TAG_EDSA
> -	bool
> +	bool "Ethertype DSA packet tagging format"
> +	select NET_DSA
>  	default n
> 
>  config NET_DSA_TAG_TRAILER
> -	bool
> +	bool "Trailer DSA packet tagging format"
> +	select NET_DSA
>  	default n
> -
> -endif
> +endmenu
> 
> _______________________________________________
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  7:53       ` Daniel Lezcano
@ 2012-10-30  7:55         ` Viresh Kumar
  2012-10-30  9:00           ` Daniel Lezcano
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-30  7:55 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 30 October 2012 13:23, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>> From: Viresh Kumar <viresh.kumar@linaro.org>

>>  config NET_DSA_TAG_DSA
>> -     bool
>> +     bool "Original DSA packet tagging format"
>> +     select NET_DSt
>
> typo NET_DSA

Unbelievable mistake :(

Will fix it after some reviews now :)

--
viresh

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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  7:55         ` Viresh Kumar
@ 2012-10-30  9:00           ` Daniel Lezcano
  2012-10-30  9:03             ` Viresh Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Lezcano @ 2012-10-30  9:00 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 10/30/2012 08:55 AM, Viresh Kumar wrote:
> On 30 October 2012 13:23, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>>> From: Viresh Kumar <viresh.kumar@linaro.org>
> 
>>>  config NET_DSA_TAG_DSA
>>> -     bool
>>> +     bool "Original DSA packet tagging format"
>>> +     select NET_DSt
>>
>> typo NET_DSA
> 
> Unbelievable mistake :(
> 
> Will fix it after some reviews now :)

Yeah, has to be ! ;)

It is very curious if we disable all the configs option, a slave
creation raise a BUG (cf. dsa_slave_create). IIUC, booting with NET_DSA
enabled and none of the NET_DSA_TAG* enabled will raise a BUG in the
probe function, right ?

Maybe we should force at least one config when none are set ?

diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index 274791c..86326e3 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -1,8 +1,9 @@
-config NET_DSA
+menuconfig NET_DSA
        tristate "Distributed Switch Architecture support"
        default n
        depends on EXPERIMENTAL && NETDEVICES && !S390
        select PHYLIB
+       select NET_DSA_TAG_DSA if (!NET_DSA_TAG_EDSA &&
!NET_DSA_TAG_TRAILER)
        ---help---
          This allows you to use hardware switch chips that use
          the Distributed Switch Architecture.
@@ -12,15 +13,15 @@ if NET_DSA

 # tagging formats
 config NET_DSA_TAG_DSA
-       bool
+       bool "tag dsa"
        default n

 config NET_DSA_TAG_EDSA
-       bool
+       bool "tag edsa"
        default n

 config NET_DSA_TAG_TRAILER
-       bool
+       bool "tag trailer"
        default n

 endif


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  9:00           ` Daniel Lezcano
@ 2012-10-30  9:03             ` Viresh Kumar
  2012-10-30  9:26               ` Daniel Lezcano
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-30  9:03 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 30 October 2012 14:30, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> It is very curious if we disable all the configs option, a slave
> creation raise a BUG (cf. dsa_slave_create). IIUC, booting with NET_DSA
> enabled and none of the NET_DSA_TAG* enabled will raise a BUG in the
> probe function, right ?
>
> Maybe we should force at least one config when none are set ?

I thought of it earlier. But found the one which i posted better. As we will not
compile DSA stuff now without these tags.

--
viresh

> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
> index 274791c..86326e3 100644
> --- a/net/dsa/Kconfig
> +++ b/net/dsa/Kconfig
> @@ -1,8 +1,9 @@
> -config NET_DSA
> +menuconfig NET_DSA
>         tristate "Distributed Switch Architecture support"
>         default n
>         depends on EXPERIMENTAL && NETDEVICES && !S390
>         select PHYLIB
> +       select NET_DSA_TAG_DSA if (!NET_DSA_TAG_EDSA &&
> !NET_DSA_TAG_TRAILER)
>         ---help---
>           This allows you to use hardware switch chips that use
>           the Distributed Switch Architecture.
> @@ -12,15 +13,15 @@ if NET_DSA
>
>  # tagging formats
>  config NET_DSA_TAG_DSA
> -       bool
> +       bool "tag dsa"
>         default n
>
>  config NET_DSA_TAG_EDSA
> -       bool
> +       bool "tag edsa"
>         default n
>
>  config NET_DSA_TAG_TRAILER
> -       bool
> +       bool "tag trailer"
>         default n
>
>  endif
>
>
> --
>  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
>
> Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
> <http://twitter.com/#!/linaroorg> Twitter |
> <http://www.linaro.org/linaro-blog/> Blog
>

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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  9:03             ` Viresh Kumar
@ 2012-10-30  9:26               ` Daniel Lezcano
  2012-10-30  9:45                 ` Viresh Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Lezcano @ 2012-10-30  9:26 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 10/30/2012 10:03 AM, Viresh Kumar wrote:
> On 30 October 2012 14:30, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>> It is very curious if we disable all the configs option, a slave
>> creation raise a BUG (cf. dsa_slave_create). IIUC, booting with NET_DSA
>> enabled and none of the NET_DSA_TAG* enabled will raise a BUG in the
>> probe function, right ?
>>
>> Maybe we should force at least one config when none are set ?
> 
> I thought of it earlier. But found the one which i posted better. As we will not
> compile DSA stuff now without these tags.

Well, it is the same here, no ? Except, it is up to the user to disable
the option.


> 
> --
> viresh
> 
>> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
>> index 274791c..86326e3 100644
>> --- a/net/dsa/Kconfig
>> +++ b/net/dsa/Kconfig
>> @@ -1,8 +1,9 @@
>> -config NET_DSA
>> +menuconfig NET_DSA
>>         tristate "Distributed Switch Architecture support"
>>         default n
>>         depends on EXPERIMENTAL && NETDEVICES && !S390
>>         select PHYLIB
>> +       select NET_DSA_TAG_DSA if (!NET_DSA_TAG_EDSA &&
>> !NET_DSA_TAG_TRAILER)
>>         ---help---
>>           This allows you to use hardware switch chips that use
>>           the Distributed Switch Architecture.
>> @@ -12,15 +13,15 @@ if NET_DSA
>>
>>  # tagging formats
>>  config NET_DSA_TAG_DSA
>> -       bool
>> +       bool "tag dsa"
>>         default n
>>
>>  config NET_DSA_TAG_EDSA
>> -       bool
>> +       bool "tag edsa"
>>         default n
>>
>>  config NET_DSA_TAG_TRAILER
>> -       bool
>> +       bool "tag trailer"
>>         default n
>>
>>  endif
>>
>>
>> --
>>  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
>>
>> Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
>> <http://twitter.com/#!/linaroorg> Twitter |
>> <http://www.linaro.org/linaro-blog/> Blog
>>


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  9:26               ` Daniel Lezcano
@ 2012-10-30  9:45                 ` Viresh Kumar
  2012-10-30 10:04                   ` Daniel Lezcano
  0 siblings, 1 reply; 12+ messages in thread
From: Viresh Kumar @ 2012-10-30  9:45 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 30 October 2012 14:56, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> Well, it is the same here, no ? Except, it is up to the user to disable
> the option.

I didn't wanted to add code like this:

>> +       select NET_DSA_TAG_DSA if (!NET_DSA_TAG_EDSA &&
>> !NET_DSA_TAG_TRAILER)

Why should we select NET_DSA_TAG_DSA by default? What made us
select that?

For this reason, i went to the solution i offered.

Anyway, i just wanted to get rid of the warning. Whatever maintainer
feels is better must be selected.

--
viresh

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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
  2012-10-30  9:45                 ` Viresh Kumar
@ 2012-10-30 10:04                   ` Daniel Lezcano
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Lezcano @ 2012-10-30 10:04 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Ben Hutchings, netdev, linaro-dev, davem, linux-kernel, patches

On 10/30/2012 10:45 AM, Viresh Kumar wrote:
> On 30 October 2012 14:56, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>> Well, it is the same here, no ? Except, it is up to the user to disable
>> the option.
> 
> I didn't wanted to add code like this:
> 
>>> +       select NET_DSA_TAG_DSA if (!NET_DSA_TAG_EDSA &&
>>> !NET_DSA_TAG_TRAILER)
> 
> Why should we select NET_DSA_TAG_DSA by default? What made us
> select that?

That was an example, like you I don't know the DSA at all.
I guess the maintainer will guide on that.

> For this reason, i went to the solution i offered.

Ok.

> Anyway, i just wanted to get rid of the warning. Whatever maintainer
> feels is better must be selected.

Yep.

  -- Daniel

-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] net: dsa/slave: Fix compilation warnings
       [not found]       ` <CAKohponOKk5e2Sxyhjw-XvzVxF3tNp66rsnYCwvwHazAPAauKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-11-07  3:50         ` Viresh Kumar
  0 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2012-11-07  3:50 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linaro-dev-cunTk1MwBs8s++Sfvej+rw,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	patches-QSEj5FYQhm4dnm+yROfE0A


[-- Attachment #1.1: Type: text/plain, Size: 3073 bytes --]

On 30 October 2012 13:01, Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:


> From: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Date: Mon, 29 Oct 2012 22:19:14 +0530
> Subject: [PATCH] net: dsa/slave: Fix compilation warnings
>

Ping!!


>
> Currently when none of CONFIG_NET_DSA_TAG_DSA, CONFIG_NET_DSA_TAG_EDSA and
> CONFIG_NET_DSA_TAG_TRAILER is defined, we get following compilation
> warnings:
>
> net/dsa/slave.c:51:12: warning: 'dsa_slave_init' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:60:12: warning: 'dsa_slave_open' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:98:12: warning: 'dsa_slave_close' defined but not used
> [-Wunused-function]
> net/dsa/slave.c:116:13: warning: 'dsa_slave_change_rx_flags' defined
> but not used [-Wunused-function]
> net/dsa/slave.c:127:13: warning: 'dsa_slave_set_rx_mode' defined but
> not used [-Wunused-function]
> net/dsa/slave.c:136:12: warning: 'dsa_slave_set_mac_address' defined
> but not used [-Wunused-function]
> net/dsa/slave.c:164:12: warning: 'dsa_slave_ioctl' defined but not
> used [-Wunused-function]
>
> Earlier approach to fix this was discussed here:
>
> lkml.org/lkml/2012/10/29/549
>
> This is another approach to fix it. This is done by some changes in config
> options, which make more sense than the earlier approach. As, atleast one
> tagging option must always be selected for using net/dsa/ infrastructure,
> this
> patch selects NET_DSA from tagging configs instead of having it as an
> selectable
> config.
>
> Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/net/dsa/Kconfig |  1 -
>  net/dsa/Kconfig         | 16 +++++++++-------
>  2 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
> index dd151d5..96eae22 100644
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -1,5 +1,4 @@
>  menu "Distributed Switch Architecture drivers"
> -       depends on NET_DSA
>
>  config NET_DSA_MV88E6XXX
>         tristate
> diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
> index 274791c..f7c6cef 100644
> --- a/net/dsa/Kconfig
> +++ b/net/dsa/Kconfig
> @@ -1,5 +1,5 @@
>  config NET_DSA
> -       tristate "Distributed Switch Architecture support"
> +       tristate
>         default n
>         depends on EXPERIMENTAL && NETDEVICES && !S390
>         select PHYLIB
> @@ -8,19 +8,21 @@ config NET_DSA
>           the Distributed Switch Architecture.
>
>
> -if NET_DSA
> +menu "Distributed Switch Architecture support"
>
>  # tagging formats
>  config NET_DSA_TAG_DSA
> -       bool
> +       bool "Original DSA packet tagging format"
> +       select NET_DSt
>         default n
>
>  config NET_DSA_TAG_EDSA
> -       bool
> +       bool "Ethertype DSA packet tagging format"
> +       select NET_DSA
>         default n
>
>  config NET_DSA_TAG_TRAILER
> -       bool
> +       bool "Trailer DSA packet tagging format"
> +       select NET_DSA
>         default n
> -
> -endif
> +endmenu
>

[-- Attachment #1.2: Type: text/html, Size: 4165 bytes --]

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

_______________________________________________
linaro-dev mailing list
linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

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

end of thread, other threads:[~2012-11-07  3:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 16:57 [PATCH] net: dsa/slave: Fix compilation warnings Viresh Kumar
2012-10-29 19:59 ` Ben Hutchings
2012-10-30  6:45   ` Viresh Kumar
2012-10-30  7:31     ` Viresh Kumar
2012-10-30  7:53       ` Daniel Lezcano
2012-10-30  7:55         ` Viresh Kumar
2012-10-30  9:00           ` Daniel Lezcano
2012-10-30  9:03             ` Viresh Kumar
2012-10-30  9:26               ` Daniel Lezcano
2012-10-30  9:45                 ` Viresh Kumar
2012-10-30 10:04                   ` Daniel Lezcano
     [not found]       ` <CAKohponOKk5e2Sxyhjw-XvzVxF3tNp66rsnYCwvwHazAPAauKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-07  3:50         ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.