diff mbox

net: dsa/slave: Fix compilation warnings

Message ID 508F9724.50804@linaro.org
State New
Headers show

Commit Message

Daniel Lezcano Oct. 30, 2012, 9 a.m. UTC
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 ?

          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

Comments

Viresh Kumar Oct. 30, 2012, 9:03 a.m. UTC | #1
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
>
Daniel Lezcano Oct. 30, 2012, 9:26 a.m. UTC | #2
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
>>
Viresh Kumar Oct. 30, 2012, 9:45 a.m. UTC | #3
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
Daniel Lezcano Oct. 30, 2012, 10:04 a.m. UTC | #4
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
diff mbox

Patch

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