Skip to contentSkip to conversation

net: stmmac: remove write-only priv->speed

PATCH Applied Russell King (Oracle) 3 participants 3 messages Mar 7, 2025 – Mar 8, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: remove write-only priv->speed

priv->speed is only ever written to in two locations, but never read. Therefore, it serves no useful purpose. Remove this unnecessary struct member.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      | 1 -
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ---
 2 files changed, 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac.h +0 -1
index 04197496ee87..bddfa0f4aa21 100644
@@ -282,7 +282,6 @@ struct stmmac_priv {
 	/* Generic channel for NAPI */
 	struct stmmac_channel channel[STMMAC_CH_MAX];
 
-	int speed;
 	unsigned int pause_time;
 	struct mii_bus *mii;
 
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -3
index 2ce18f52b717..982b7d82fd53 100644
@@ -1029,8 +1029,6 @@ static void stmmac_mac_link_up(struct phylink_config *config,
 		}
 	}
 
-	priv->speed = speed;
-
 	if (priv->plat->fix_mac_speed)
 		priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed, mode);
 
@@ -7859,7 +7857,6 @@ int stmmac_suspend(struct device *dev)
 	if (stmmac_fpe_supported(priv))
 		timer_shutdown_sync(&priv->fpe_cfg.verify_timer);
 
-	priv->speed = SPEED_UNKNOWN;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(stmmac_suspend);
Signature · 1 line
2.30.2
#2 lore raw
In reply to Russell King (Oracle)
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 07 Mar 2025 00:11:29 +0000 you wrote:

priv->speed is only ever written to in two locations, but never read. Therefore, it serves no useful purpose. Remove this unnecessary struct member.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h      | 1 -
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ---
 2 files changed, 4 deletions(-)

Here is the summary with links:
- [net-next] net: stmmac: remove write-only priv->speed

    https://git.kernel.org/netdev/net-next/c/64fdb808660d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html