Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <hkallweit1@gmail.com>
Link: https://patch.msgid.link/f0daefa4-406a-4a06-a4f0-7e31309f82bc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
c5230587 a41851be

+4
+4
include/linux/phy.h
··· 409 409 /** @shared_lock: protect access to the shared element */ 410 410 struct mutex shared_lock; 411 411 412 + #if IS_ENABLED(CONFIG_PHY_PACKAGE) 412 413 /** @shared: shared state across different PHYs */ 413 414 struct phy_package_shared *shared[PHY_MAX_ADDR]; 415 + #endif 414 416 }; 415 417 #define to_mii_bus(d) container_of(d, struct mii_bus, dev) 416 418 ··· 720 718 /* For use by PHYs to maintain extra state */ 721 719 void *priv; 722 720 721 + #if IS_ENABLED(CONFIG_PHY_PACKAGE) 723 722 /* shared data pointer */ 724 723 /* For use by PHYs inside the same package that need a shared state. */ 725 724 struct phy_package_shared *shared; 725 + #endif 726 726 727 727 /* Reporting cable test results */ 728 728 struct sk_buff *skb;