diff options
| author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-02-18 13:24:39 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-20 05:57:28 +0300 |
| commit | ac9a8587edc78f3a66fdf6a99973ef151cbff72a (patch) | |
| tree | 727a928e1d5c3437b27858fe0777046a36c39602 /include/linux | |
| parent | bc9d75b0aaed795dcd6009336500fd6094e0c944 (diff) | |
| download | linux-ac9a8587edc78f3a66fdf6a99973ef151cbff72a.tar.xz | |
net: stmmac: "speed" passed to fix_mac_speed is an int
priv->plat->fix_mac_speed() is called from stmmac_mac_link_up(), which
is passed the speed as an "int". However, fix_mac_speed() implicitly
casts this to an unsigned int. Some platform glue code print this value
using %u, others with %d. Some implicitly cast it back to an int, and
others to u32.
Good practice is to use one type and only one type to represent a value
being passed around a driver.
Switch all of these over to consistently use "int" when dealing with a
speed passed from stmmac_mac_link_up(), even though the speed will
always be positive.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Link: https://patch.msgid.link/E1tkKmN-004ObM-Ge@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/stmmac.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 24422ac4e417..6d2aa77ea963 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -231,7 +231,7 @@ struct plat_stmmacenet_data { u8 tx_sched_algorithm; struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES]; struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES]; - void (*fix_mac_speed)(void *priv, unsigned int speed, unsigned int mode); + void (*fix_mac_speed)(void *priv, int speed, unsigned int mode); int (*fix_soc_reset)(void *priv, void __iomem *ioaddr); int (*serdes_powerup)(struct net_device *ndev, void *priv); void (*serdes_powerdown)(struct net_device *ndev, void *priv); |
