Skip to contentSkip to conversation

net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization

PATCH Applied Jisheng Zhang 3 participants 3 messages Aug 3 – Aug 4

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

PATCH 1/1 net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization

These so called "safe" initializations aren't needed any more from sometime, but the unnecessaries are obvious after recent clean up by Russell. The code will correctly initialize them after getting the correct stmmac_hwif_entry by calling stmmac_hwif_find().

---
 drivers/net/ethernet/stmicro/stmmac/hwif.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/net/ethernet/stmicro/stmmac/hwif.c +0 -12
index 511b0fd5e834..265671170bf6 100644
@@ -328,18 +328,6 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
 	/* Save ID for later use */
 	priv->synopsys_id = version.snpsver;
 
-	/* Lets assume some safe values first */
-	if (core_type == DWMAC_CORE_GMAC4) {
-		priv->ptpaddr = priv->ioaddr + PTP_GMAC4_OFFSET;
-		priv->mmcaddr = priv->ioaddr + MMC_GMAC4_OFFSET;
-		priv->estaddr = priv->ioaddr + EST_GMAC4_OFFSET;
-	} else {
-		priv->ptpaddr = priv->ioaddr + PTP_GMAC3_X_OFFSET;
-		priv->mmcaddr = priv->ioaddr + MMC_GMAC3_X_OFFSET;
-		if (core_type == DWMAC_CORE_XGMAC)
-			priv->estaddr = priv->ioaddr + EST_XGMAC_OFFSET;
-	}
-
 	mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL);
 	if (!mac)
 		return -ENOMEM;
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi,

Don't forget to put the tree name in the subject please :

https://docs.kernel.org/process/maintainer-netdev.html

That one's for net-next, thanks for the cleanup

Quoted 23 lines · Jisheng Zhang

These so called "safe" initializations aren't needed any more from sometime, but the unnecessaries are obvious after recent clean up by Russell. The code will correctly initialize them after getting the correct stmmac_hwif_entry by calling stmmac_hwif_find().

---
 drivers/net/ethernet/stmicro/stmmac/hwif.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/net/ethernet/stmicro/stmmac/hwif.c +0 -5
index 511b0fd5e834..265671170bf6 100644
@@ -328,18 +328,6 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
 	/* Save ID for later use */
 	priv->synopsys_id = version.snpsver;
 
-	/* Lets assume some safe values first */
-	if (core_type == DWMAC_CORE_GMAC4) {
-		priv->ptpaddr = priv->ioaddr + PTP_GMAC4_OFFSET;
-		priv->mmcaddr = priv->ioaddr + MMC_GMAC4_OFFSET;
-		priv->estaddr = priv->ioaddr + EST_GMAC4_OFFSET;

drivers/net/ethernet/stmicro/stmmac/hwif.c int stmmac_hwif_init(struct stmmac_priv *priv) · line 333

Quoted 10 lines
drivers/net/ethernet/stmicro/stmmac/hwif.c +0 -7
-	} else {
-		priv->ptpaddr = priv->ioaddr + PTP_GMAC3_X_OFFSET;
-		priv->mmcaddr = priv->ioaddr + MMC_GMAC3_X_OFFSET;
-		if (core_type == DWMAC_CORE_XGMAC)
-			priv->estaddr = priv->ioaddr + EST_XGMAC_OFFSET;
-	}
-
 	mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL);
 	if (!mac)
 		return -ENOMEM;

Maxime

#2 lore raw
In reply to Jisheng Zhang
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 8 lines · On Mon, 3 Aug 2026 21:57:45 +0800 you wrote:

These so called "safe" initializations aren't needed any more from sometime, but the unnecessaries are obvious after recent clean up by Russell. The code will correctly initialize them after getting the correct stmmac_hwif_entry by calling stmmac_hwif_find().

[...]

Here is the summary with links:
- net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization

    https://git.kernel.org/netdev/net-next/c/95a390ce6aee

You are awesome, thank you!

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