]> www.infradead.org Git - users/hch/misc.git/commit
net: stmmac: use correct type for tx_lpi_timer
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 8 Jan 2025 16:47:44 +0000 (16:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Jan 2025 01:51:00 +0000 (17:51 -0800)
commitbba9f4765515d45b3fd71ebf4a622e830b412f45
tree28742753b308e8d95639feaddfc5b0790f297790
parent1991819debaa22ee75f4163f3b17f9e545f3ae98
net: stmmac: use correct type for tx_lpi_timer

The ethtool interface uses u32 for tx_lpi_timer, and so does phylib.
Use u32 to store this internally within stmmac rather than "int"
which could misinterpret large values.

Correct "value" in dwmac4_set_eee_lpi_entry_timer() to use u32
rather than int, which is derived from tx_lpi_timer. Even though this
path won't be used with values larger than STMMAC_ET_MAX, this brings
consistency of type usage to the stmmac code for this variable.

We leave eee_timer unchanged for now, with the assumption that values
up to INT_MAX will safely fit in a u32.

Tested-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tVZDc-0002Jx-3b@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c