RE: [PATCH net-next 2/3] net: stmmac: remove useless priv->flow_ctrl
From: <hidden>
Date: 2025-02-19 01:13:18
Also in:
imx, linux-amlogic, linux-arm-msm, linux-riscv, linux-sunxi, netdev
Hi Russell,
-----Original Message----- From: Russell King <redacted> On Behalf Of Russell King (Oracle) Sent: Tuesday, February 18, 2025 7:25 PM To: netdev@vger.kernel.org Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>; Andrew Lunn [off-list ref]; Chen-Yu Tsai [off-list ref]; David S. Miller [off-list ref]; Drew Fustini [off-list ref]; Emil Renner Berthing [off-list ref]; Eric Dumazet [off-list ref]; Fabio Estevam [off-list ref]; Fu Wei [off-list ref]; Guo Ren [off-list ref]; imx@lists.linux.dev; Jakub Kicinski [off-list ref]; Jan Petrous [off-list ref]; Jernej Skrabec [off-list ref]; Jerome Brunet [off-list ref]; Kevin Hilman [off-list ref]; linux-amlogic@lists.infradead.org; linux-arm-kernel@lists.infradead.org; linux-arm-msm@vger.kernel.org; linux-riscv@lists.infradead.org; linux-stm32@st-md-mailman.stormreply.com; linux-sunxi@lists.linux.dev; Martin Blumenstingl [off-list ref]; Maxime Coquelin [off-list ref]; Minda Chen [off-list ref]; Neil Armstrong [off-list ref]; iwamatsu nobuhiro(岩松 信洋 ○DITC□D IT○OST) [off-list ref]; NXP S32 Linux Team [off-list ref]; Paolo Abeni [off-list ref]; Pengutronix Kernel Team [off-list ref]; Samuel Holland [off-list ref]; Sascha Hauer [off-list ref]; Shawn Guo [off-list ref]; Vinod Koul [off-list ref] Subject: [PATCH net-next 2/3] 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) <redacted>
Reviewed-by: Nobuhiro Iwamatsu <redacted> Best regards, Nobuhiro