Thread (11 messages) 11 messages, 7 authors, 2025-02-20

Re: [PATCH net-next 3/3] net: stmmac: "speed" passed to fix_mac_speed is an int

From: Chen-Yu Tsai <hidden>
Date: 2025-02-18 12:29:18
Also in: imx, linux-amlogic, linux-arm-msm, linux-riscv, linux-sunxi, netdev

On Tue, Feb 18, 2025 at 6:25 PM Russell King (Oracle)
[off-list ref] wrote:
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) <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c       | 2 +-
Acked-by: Chen-Yu Tsai <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help