]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: stmmac: remove useless priv->flow_ctrl
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 18 Feb 2025 10:24:34 +0000 (10:24 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Feb 2025 02:57:28 +0000 (18:57 -0800)
commitbc9d75b0aaed795dcd6009336500fd6094e0c944
treefa8421fb51020041df2bf0409b94c13f1497605b
parentff1a9b2e311f6894afe39b0000dc7482498eb2d1
net: stmmac: remove useless priv->flow_ctrl

priv->flow_ctrl is only accessed by stmmac_main.c, and the only place
that it is read is in stmmac_mac_flow_ctrl(). This function is only
called from stmmac_mac_link_up() which always sets priv->flow_ctrl
immediately before calling this function.

Therefore, initialising this at probe time is ineffectual because it
will always be overwritten before it's read. As such, the "flow_ctrl"
module parameter has been useless for some time. Rather than remove
the module parameter, which would risk module load failure, change the
description to indicate that it is obsolete, and warn if it is set by
userspace.

Moreover, storing the value in the stmmac_priv has no benefit as it's
set and then immediately read stmmac_mac_flow_ctrl(). Instead, pass it
as a parameter to this function..

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Link: https://patch.msgid.link/E1tkKmI-004ObG-DL@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c