From: Russell King (Oracle) Date: Sun, 31 Aug 2025 17:34:33 +0000 (+0100) Subject: net: phy: add phy_interface_weight() X-Git-Tag: v6.17-rc5~21^2~24^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4beb44a2d62dddfe450f310aa1a950901731cb3a;p=thirdparty%2Fkernel%2Flinux.git net: phy: add phy_interface_weight() Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/E1uslwn-00000001SOx-0a7H@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- diff --git a/include/linux/phy.h b/include/linux/phy.h index 4c2b8b6e71879..bb45787d86848 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -169,6 +169,11 @@ static inline bool phy_interface_empty(const unsigned long *intf) return bitmap_empty(intf, PHY_INTERFACE_MODE_MAX); } +static inline unsigned int phy_interface_weight(const unsigned long *intf) +{ + return bitmap_weight(intf, PHY_INTERFACE_MODE_MAX); +} + static inline void phy_interface_and(unsigned long *dst, const unsigned long *a, const unsigned long *b) {