linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset()
@ 2025-08-12 12:13 Waqar Hameed
  2025-08-12 18:17 ` Joe Damato
  2025-08-14  0:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Waqar Hameed @ 2025-08-12 12:13 UTC (permalink / raw)
  To: Claudiu Manoil, Vladimir Oltean, Wei Fang, Clark Wang,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: kernel, imx, netdev, linux-kernel

When `devm_add_action_or_reset()` fails, it is due to a failed memory
allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do
anything when error is `-ENOMEM`. Therefore, remove the useless call to
`dev_err_probe()` when `devm_add_action_or_reset()` fails, and just
return the value instead.

Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
---
Changes in v2:

* Split the patch to one seperate patch for each sub-system.

Link to v1: https://lore.kernel.org/all/pnd7c0s6ji2.fsf@axis.com/

 drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
index b3dc1afeefd1..38fb81db48c2 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
@@ -1016,8 +1016,7 @@ static int enetc4_pf_probe(struct pci_dev *pdev,
 
 	err = devm_add_action_or_reset(dev, enetc4_pci_remove, pdev);
 	if (err)
-		return dev_err_probe(dev, err,
-				     "Add enetc4_pci_remove() action failed\n");
+		return err;
 
 	/* si is the private data. */
 	si = pci_get_drvdata(pdev);

base-commit: 53e760d8949895390e256e723e7ee46618310361
-- 
2.39.5


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

* Re: [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset()
  2025-08-12 12:13 [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset() Waqar Hameed
@ 2025-08-12 18:17 ` Joe Damato
  2025-08-14  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Damato @ 2025-08-12 18:17 UTC (permalink / raw)
  To: Waqar Hameed
  Cc: Claudiu Manoil, Vladimir Oltean, Wei Fang, Clark Wang,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, kernel, imx, netdev, linux-kernel

On Tue, Aug 12, 2025 at 02:13:58PM +0200, Waqar Hameed wrote:
> When `devm_add_action_or_reset()` fails, it is due to a failed memory
> allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do
> anything when error is `-ENOMEM`. Therefore, remove the useless call to
> `dev_err_probe()` when `devm_add_action_or_reset()` fails, and just
> return the value instead.
> 
> Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
> ---
> Changes in v2:
> 
> * Split the patch to one seperate patch for each sub-system.
> 
> Link to v1: https://lore.kernel.org/all/pnd7c0s6ji2.fsf@axis.com/
> 
>  drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> index b3dc1afeefd1..38fb81db48c2 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
> @@ -1016,8 +1016,7 @@ static int enetc4_pf_probe(struct pci_dev *pdev,
>  
>  	err = devm_add_action_or_reset(dev, enetc4_pci_remove, pdev);
>  	if (err)
> -		return dev_err_probe(dev, err,
> -				     "Add enetc4_pci_remove() action failed\n");
> +		return err;

I looked at a couple other drivers that use devm_add_action_or_reset and most
follow the pattern proposed by this change.

Reviewed-by: Joe Damato <joe@dama.to>

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

* Re: [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset()
  2025-08-12 12:13 [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset() Waqar Hameed
  2025-08-12 18:17 ` Joe Damato
@ 2025-08-14  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-14  0:40 UTC (permalink / raw)
  To: Waqar Hameed
  Cc: claudiu.manoil, vladimir.oltean, wei.fang, xiaoning.wang,
	andrew+netdev, davem, edumazet, kuba, pabeni, kernel, imx, netdev,
	linux-kernel

Hello:

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

On Tue, 12 Aug 2025 14:13:58 +0200 you wrote:
> When `devm_add_action_or_reset()` fails, it is due to a failed memory
> allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do
> anything when error is `-ENOMEM`. Therefore, remove the useless call to
> `dev_err_probe()` when `devm_add_action_or_reset()` fails, and just
> return the value instead.
> 
> Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
> 
> [...]

Here is the summary with links:
  - [RESEND,net-next,v2] net: enetc: Remove error print for devm_add_action_or_reset()
    https://git.kernel.org/netdev/net-next/c/3051f49b0e03

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:[~2025-08-14  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12 12:13 [PATCH RESEND net-next v2] net: enetc: Remove error print for devm_add_action_or_reset() Waqar Hameed
2025-08-12 18:17 ` Joe Damato
2025-08-14  0:40 ` 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;
as well as URLs for NNTP newsgroup(s).