net: phy: declare package-related struct members only if CONFIG_PHY_PACKAGE is enabled
Subsystems (3)
Heiner Kallweit
maintainerPATCH 1/1 net: phy: declare package-related struct members only if CONFIG_PHY_PACKAGE is enabled
Now that we have an own config symbol for the PHY package module, we can use it to reduce size of these structs if it isn't enabled.
Signed-off-by Heiner Kallweit <[email protected]>
--- include/linux/phy.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/phy.h +4 -0
@@ -409,8 +409,10 @@ struct mii_bus {/** @shared_lock: protect access to the shared element */ struct mutex shared_lock; +#if IS_ENABLED (CONFIG_PHY_PACKAGE )/** @shared: shared state across different PHYs */ struct phy_package_shared *shared[PHY_MAX_ADDR ]; +#endif };#define to_mii_bus (d) container_of(d, struct mii_bus, dev)
@@ -718,9 +720,11 @@ struct phy_device {/* For use by PHYs to maintain extra state */ void *priv; +#if IS_ENABLED (CONFIG_PHY_PACKAGE )/* shared data pointer */ /* For use by PHYs inside the same package that need a shared state. */ struct phy_package_shared *shared; +#endif /* Reporting cable test results */ struct sk_buff *skb;
Signature · 1 line
2.50.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Thu, 3 Jul 2025 07:55:52 +0200 you wrote:
Now that we have an own config symbol for the PHY package module, we can use it to reduce size of these structs if it isn't enabled.
Signed-off-by Heiner Kallweit <[email protected]>--- include/linux/phy.h | 4 ++++ 1 file changed, 4 insertions(+)
Here is the summary with links:
- [net-next] net: phy: declare package-related struct members only if CONFIG_PHY_PACKAGE is enabled
https://git.kernel.org/netdev/net-next/c/c523058713ab
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html