The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization
@ 2026-08-03 13:57 Jisheng Zhang
  2026-08-03 20:27 ` Maxime Chevallier
  2026-08-04 21:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jisheng Zhang @ 2026-08-03 13:57 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Maxime Coquelin, Alexandre Torgue
  Cc: Russell King, netdev, linux-stm32, linux-arm-kernel, linux-kernel

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().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/hwif.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index 511b0fd5e834..265671170bf6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -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;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization
  2026-08-03 13:57 [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization Jisheng Zhang
@ 2026-08-03 20:27 ` Maxime Chevallier
  2026-08-04 21:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-08-03 20:27 UTC (permalink / raw)
  To: Jisheng Zhang, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue
  Cc: Russell King, netdev, linux-stm32, linux-arm-kernel, linux-kernel

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

On 8/3/26 15:57, Jisheng Zhang 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().
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/net/ethernet/stmicro/stmmac/hwif.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
> index 511b0fd5e834..265671170bf6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
> @@ -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;

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization
  2026-08-03 13:57 [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization Jisheng Zhang
  2026-08-03 20:27 ` Maxime Chevallier
@ 2026-08-04 21:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-04 21:50 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue, rmk+kernel, netdev, linux-stm32,
	linux-arm-kernel, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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().
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-04 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 13:57 [PATCH] net: stmmac: remove ptpaddr/mmcaddr/estaddr "safe" initialization Jisheng Zhang
2026-08-03 20:27 ` Maxime Chevallier
2026-08-04 21:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox