diff mbox series

net: dsa: restrict SMSC_LAN9303_I2C kconfig

Message ID 20220519213351.9020-1-rdunlap@infradead.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: restrict SMSC_LAN9303_I2C kconfig | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: robh@kernel.org; 1 maintainers not CCed: robh@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Randy Dunlap May 19, 2022, 9:33 p.m. UTC
Since kconfig 'select' does not follow dependency chains, if symbol KSA
selects KSB, then KSA should also depend on the same symbols that KSB
depends on, in order to prevent Kconfig warnings and possible build
errors.

Change NET_DSA_SMSC_LAN9303_I2C so that it is limited to VLAN_8021Q if
the latter is enabled and results in changing NET_DSA_SMSC_LAN9303_I2C
from =y to =m and eliminating the kconfig warning.

WARNING: unmet direct dependencies detected for NET_DSA_SMSC_LAN9303
  Depends on [m]: NETDEVICES [=y] && NET_DSA [=y] && (VLAN_8021Q [=m] || VLAN_8021Q [=m]=n)
  Selected by [y]:
  - NET_DSA_SMSC_LAN9303_I2C [=y] && NETDEVICES [=y] && NET_DSA [=y] && I2C [=y]

Fixes: be4e119f9914 ("net: dsa: LAN9303: add I2C managed mode support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>
Cc: Juergen Borleis <jbe@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/dsa/Kconfig |    1 +
 1 file changed, 1 insertion(+)

Comments

Vladimir Oltean May 19, 2022, 11:09 p.m. UTC | #1
Hi Randy,

On Thu, May 19, 2022 at 02:33:51PM -0700, Randy Dunlap wrote:
> Since kconfig 'select' does not follow dependency chains, if symbol KSA
> selects KSB, then KSA should also depend on the same symbols that KSB
> depends on, in order to prevent Kconfig warnings and possible build
> errors.
> 
> Change NET_DSA_SMSC_LAN9303_I2C so that it is limited to VLAN_8021Q if
> the latter is enabled and results in changing NET_DSA_SMSC_LAN9303_I2C
> from =y to =m and eliminating the kconfig warning.
> 
> WARNING: unmet direct dependencies detected for NET_DSA_SMSC_LAN9303
>   Depends on [m]: NETDEVICES [=y] && NET_DSA [=y] && (VLAN_8021Q [=m] || VLAN_8021Q [=m]=n)
>   Selected by [y]:
>   - NET_DSA_SMSC_LAN9303_I2C [=y] && NETDEVICES [=y] && NET_DSA [=y] && I2C [=y]
> 
> Fixes: be4e119f9914 ("net: dsa: LAN9303: add I2C managed mode support")

The Fixes: tag is incorrect. It should be:

Fixes: 430065e26719 ("net: dsa: lan9303: add VLAN IDs to master device")

> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Vivien Didelot <vivien.didelot@gmail.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Vladimir Oltean <olteanv@gmail.com>
> Cc: Juergen Borleis <jbe@pengutronix.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> ---
>  drivers/net/dsa/Kconfig |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -82,6 +82,7 @@ config NET_DSA_SMSC_LAN9303
>  config NET_DSA_SMSC_LAN9303_I2C
>  	tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode"
>  	depends on I2C
> +	depends on VLAN_8021Q || VLAN_8021Q=n

I'm pretty sure that NET_DSA_SMSC_LAN9303_MDIO needs the same treatment
as NET_DSA_SMSC_LAN9303_I2C. And the "depends" line can now be removed
from NET_DSA_SMSC_LAN9303, it serves no purpose.

>  	select NET_DSA_SMSC_LAN9303
>  	select REGMAP_I2C
>  	help
Randy Dunlap May 20, 2022, 5:15 a.m. UTC | #2
Hi,

On 5/19/22 16:09, Vladimir Oltean wrote:
> Hi Randy,
> 
> On Thu, May 19, 2022 at 02:33:51PM -0700, Randy Dunlap wrote:
>> Since kconfig 'select' does not follow dependency chains, if symbol KSA
>> selects KSB, then KSA should also depend on the same symbols that KSB
>> depends on, in order to prevent Kconfig warnings and possible build
>> errors.
>>
>> Change NET_DSA_SMSC_LAN9303_I2C so that it is limited to VLAN_8021Q if
>> the latter is enabled and results in changing NET_DSA_SMSC_LAN9303_I2C
>> from =y to =m and eliminating the kconfig warning.
>>
>> WARNING: unmet direct dependencies detected for NET_DSA_SMSC_LAN9303
>>   Depends on [m]: NETDEVICES [=y] && NET_DSA [=y] && (VLAN_8021Q [=m] || VLAN_8021Q [=m]=n)
>>   Selected by [y]:
>>   - NET_DSA_SMSC_LAN9303_I2C [=y] && NETDEVICES [=y] && NET_DSA [=y] && I2C [=y]
>>
>> Fixes: be4e119f9914 ("net: dsa: LAN9303: add I2C managed mode support")
> 
> The Fixes: tag is incorrect. It should be:
> 
> Fixes: 430065e26719 ("net: dsa: lan9303: add VLAN IDs to master device")

Corrected. Thanks.
> 
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: Vivien Didelot <vivien.didelot@gmail.com>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: Vladimir Oltean <olteanv@gmail.com>
>> Cc: Juergen Borleis <jbe@pengutronix.de>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Jakub Kicinski <kuba@kernel.org>
>> Cc: Paolo Abeni <pabeni@redhat.com>
>> ---
>>  drivers/net/dsa/Kconfig |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> --- a/drivers/net/dsa/Kconfig
>> +++ b/drivers/net/dsa/Kconfig
>> @@ -82,6 +82,7 @@ config NET_DSA_SMSC_LAN9303
>>  config NET_DSA_SMSC_LAN9303_I2C
>>  	tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode"
>>  	depends on I2C
>> +	depends on VLAN_8021Q || VLAN_8021Q=n
> 
> I'm pretty sure that NET_DSA_SMSC_LAN9303_MDIO needs the same treatment
> as NET_DSA_SMSC_LAN9303_I2C. And the "depends" line can now be removed
> from NET_DSA_SMSC_LAN9303, it serves no purpose.

Ok, v2 on the way.

>>  	select NET_DSA_SMSC_LAN9303
>>  	select REGMAP_I2C
>>  	help
diff mbox series

Patch

--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -82,6 +82,7 @@  config NET_DSA_SMSC_LAN9303
 config NET_DSA_SMSC_LAN9303_I2C
 	tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode"
 	depends on I2C
+	depends on VLAN_8021Q || VLAN_8021Q=n
 	select NET_DSA_SMSC_LAN9303
 	select REGMAP_I2C
 	help