]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: make pcs_mask and phy_mask u32
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 5 Mar 2026 10:43:02 +0000 (10:43 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Mar 2026 23:39:10 +0000 (15:39 -0800)
The PCS and PHY masks are passed to the mdio bus layer as phy_mask
to prevent bus addresses between 0 and 31 inclusive being scanned,
and this is declared as u32. Also declare these as u32 in stmmac
for type consistency.

Since this is a u32, use BIT_U32() rather than BIT() to generate
values for these fields.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1vy6AY-0000000BtxJ-3smT@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
include/linux/stmmac.h

index ece2a0c38562be4dd1174fbd76117a74ecfdfaaa..fc13bfb477838f32c9a18492d51af59650a41e0b 100644 (file)
@@ -699,7 +699,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
        /* Intel mgbe SGMII interface uses pcs-xcps */
        if (plat->phy_interface == PHY_INTERFACE_MODE_SGMII ||
            plat->phy_interface == PHY_INTERFACE_MODE_1000BASEX) {
-               plat->mdio_bus_data->pcs_mask = BIT(INTEL_MGBE_XPCS_ADDR);
+               plat->mdio_bus_data->pcs_mask = BIT_U32(INTEL_MGBE_XPCS_ADDR);
                plat->mdio_bus_data->default_an_inband = true;
                plat->select_pcs = intel_mgbe_select_pcs;
        }
index b913fe5af4888741e81fc3c465230aa989066a17..ada6c6ef1f5cbdecd8127671c95c5cca17ffff80 100644 (file)
@@ -168,7 +168,7 @@ static int loongson_gnet_data(struct pci_dev *pdev,
        loongson_default_data(pdev, plat);
 
        plat->phy_interface = PHY_INTERFACE_MODE_GMII;
-       plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);
+       plat->mdio_bus_data->phy_mask = ~BIT_U32(2);
        plat->fix_mac_speed = loongson_gnet_fix_speed;
 
        return 0;
index 678d03d6d3bd81c055e0c72fe18b81fd58f6a79e..965ada809fdfe833a0324eec2f2094d96ec692d9 100644 (file)
@@ -84,8 +84,8 @@ struct stmmac_priv;
 /* Platfrom data for platform device structure's platform_data field */
 
 struct stmmac_mdio_bus_data {
-       unsigned int phy_mask;
-       unsigned int pcs_mask;
+       u32 phy_mask;
+       u32 pcs_mask;
        int *irqs;
        int probed_phy_irq;
        bool needs_reset;