[PATCH net-next 2/3] net: stmmac: remove useless priv->flow_ctrl

nobuhiro1.iwamatsu at toshiba.co.jp nobuhiro1.iwamatsu at toshiba.co.jp
Tue Feb 18 17:11:26 PST 2025


Hi Russell,

> -----Original Message-----
> From: Russell King <rmk at armlinux.org.uk> On Behalf Of Russell King (Oracle)
> Sent: Tuesday, February 18, 2025 7:25 PM
> To: netdev at vger.kernel.org
> Cc: Alexandre Torgue <alexandre.torgue at foss.st.com>; Andrew Lunn
> <andrew+netdev at lunn.ch>; Chen-Yu Tsai <wens at csie.org>; David S. Miller
> <davem at davemloft.net>; Drew Fustini <drew at pdp7.com>; Emil Renner
> Berthing <kernel at esmil.dk>; Eric Dumazet <edumazet at google.com>; Fabio
> Estevam <festevam at gmail.com>; Fu Wei <wefu at redhat.com>; Guo Ren
> <guoren at kernel.org>; imx at lists.linux.dev; Jakub Kicinski
> <kuba at kernel.org>; Jan Petrous <jan.petrous at oss.nxp.com>; Jernej Skrabec
> <jernej.skrabec at gmail.com>; Jerome Brunet <jbrunet at baylibre.com>; Kevin
> Hilman <khilman at baylibre.com>; linux-amlogic at lists.infradead.org;
> linux-arm-kernel at lists.infradead.org; linux-arm-msm at vger.kernel.org;
> linux-riscv at lists.infradead.org; linux-stm32 at st-md-mailman.stormreply.com;
> linux-sunxi at lists.linux.dev; Martin Blumenstingl
> <martin.blumenstingl at googlemail.com>; Maxime Coquelin
> <mcoquelin.stm32 at gmail.com>; Minda Chen
> <minda.chen at starfivetech.com>; Neil Armstrong
> <neil.armstrong at linaro.org>; iwamatsu nobuhiro(岩松 信洋 ○DITC□D
> IT○OST) <nobuhiro1.iwamatsu at toshiba.co.jp>; NXP S32 Linux Team
> <s32 at nxp.com>; Paolo Abeni <pabeni at redhat.com>; Pengutronix Kernel
> Team <kernel at pengutronix.de>; Samuel Holland <samuel at sholland.org>;
> Sascha Hauer <s.hauer at pengutronix.de>; Shawn Guo
> <shawnguo at kernel.org>; Vinod Koul <vkoul at kernel.org>
> 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) <rmk+kernel at armlinux.org.uk>

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu at toshiba.co.jp>

Best regards,
  Nobuhiro


More information about the linux-riscv mailing list