linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init()
@ 2025-10-20 14:02 Markus Elfring
  2025-10-20 15:51 ` Alexander Lobakin
  2025-10-23  9:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Elfring @ 2025-10-20 14:02 UTC (permalink / raw)
  To: netdev, linux-arm-kernel, Andrew Lunn, Byungchul Park,
	David S. Miller, Diogo Ivo, Eric Dumazet, Grygorii Strashko,
	Himanshu Mittal, Jakub Kicinski, Jan Kiszka, Krzysztof Kozlowski,
	MD Danish Anwar, Meghana Malladi, Paolo Abeni, Ravi Gunasekaran,
	Roger Quadros, Simon Horman, Vignesh Raghavendra
  Cc: LKML, Anand Moon, Christophe Jaillet

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 20 Oct 2025 15:46:11 +0200

An error code was assigned to a variable and checked accordingly.
This value was passed to a dev_err_probe() call in an if branch.
This function is documented in the way that the same value is returned.
Thus delete two redundant variable reassignments.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/net/ethernet/ti/icssg/icssg_prueth.c     | 3 +--
 drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index e42d0fdefee1..0bfd761bffc5 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -1248,8 +1248,7 @@ static int prueth_netdev_init(struct prueth *prueth,
 	} else if (of_phy_is_fixed_link(eth_node)) {
 		ret = of_phy_register_fixed_link(eth_node);
 		if (ret) {
-			ret = dev_err_probe(prueth->dev, ret,
-					    "failed to register fixed-link phy\n");
+			dev_err_probe(prueth->dev, ret, "failed to register fixed-link phy\n");
 			goto free;
 		}
 
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
index 5e225310c9de..bd88877e8e65 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
@@ -816,8 +816,7 @@ static int prueth_netdev_init(struct prueth *prueth,
 	} else if (of_phy_is_fixed_link(eth_node)) {
 		ret = of_phy_register_fixed_link(eth_node);
 		if (ret) {
-			ret = dev_err_probe(prueth->dev, ret,
-					    "failed to register fixed-link phy\n");
+			dev_err_probe(prueth->dev, ret, "failed to register fixed-link phy\n");
 			goto free;
 		}
 
-- 
2.51.1



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

* Re: [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init()
  2025-10-20 14:02 [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init() Markus Elfring
@ 2025-10-20 15:51 ` Alexander Lobakin
  2025-10-23  9:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Lobakin @ 2025-10-20 15:51 UTC (permalink / raw)
  To: Markus Elfring
  Cc: netdev, linux-arm-kernel, Andrew Lunn, Byungchul Park,
	David S. Miller, Diogo Ivo, Eric Dumazet, Grygorii Strashko,
	Himanshu Mittal, Jakub Kicinski, Jan Kiszka, Krzysztof Kozlowski,
	MD Danish Anwar, Meghana Malladi, Paolo Abeni, Ravi Gunasekaran,
	Roger Quadros, Simon Horman, Vignesh Raghavendra, LKML,
	Anand Moon, Christophe Jaillet

From: Markus Elfring <Markus.Elfring@web.de>
Date: Mon, 20 Oct 2025 16:02:56 +0200

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 20 Oct 2025 15:46:11 +0200
> 
> An error code was assigned to a variable and checked accordingly.
> This value was passed to a dev_err_probe() call in an if branch.
> This function is documented in the way that the same value is returned.
> Thus delete two redundant variable reassignments.
> 
> The source code was transformed by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Reviewed-by Alexander Lobakin <aleksander.lobakin@intel.com>

> ---
>  drivers/net/ethernet/ti/icssg/icssg_prueth.c     | 3 +--
>  drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> index e42d0fdefee1..0bfd761bffc5 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> @@ -1248,8 +1248,7 @@ static int prueth_netdev_init(struct prueth *prueth,
>  	} else if (of_phy_is_fixed_link(eth_node)) {
>  		ret = of_phy_register_fixed_link(eth_node);
>  		if (ret) {
> -			ret = dev_err_probe(prueth->dev, ret,
> -					    "failed to register fixed-link phy\n");
> +			dev_err_probe(prueth->dev, ret, "failed to register fixed-link phy\n");
>  			goto free;
>  		}
>  
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> index 5e225310c9de..bd88877e8e65 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> @@ -816,8 +816,7 @@ static int prueth_netdev_init(struct prueth *prueth,
>  	} else if (of_phy_is_fixed_link(eth_node)) {
>  		ret = of_phy_register_fixed_link(eth_node);
>  		if (ret) {
> -			ret = dev_err_probe(prueth->dev, ret,
> -					    "failed to register fixed-link phy\n");
> +			dev_err_probe(prueth->dev, ret, "failed to register fixed-link phy\n");
>  			goto free;
>  		}

Thanks,
Olek


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

* Re: [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init()
  2025-10-20 14:02 [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init() Markus Elfring
  2025-10-20 15:51 ` Alexander Lobakin
@ 2025-10-23  9:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-23  9:40 UTC (permalink / raw)
  To: Markus Elfring
  Cc: netdev, linux-arm-kernel, andrew+netdev, byungchul, davem,
	diogo.ivo, edumazet, grygorii.strashko, h-mittal1, kuba,
	jan.kiszka, krzysztof.kozlowski, danishanwar, m-malladi, pabeni,
	r-gunasekaran, rogerq, horms, vigneshr, linux-kernel, linux.amoon,
	christophe.jaillet

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 20 Oct 2025 16:02:56 +0200 you wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 20 Oct 2025 15:46:11 +0200
> 
> An error code was assigned to a variable and checked accordingly.
> This value was passed to a dev_err_probe() call in an if branch.
> This function is documented in the way that the same value is returned.
> Thus delete two redundant variable reassignments.
> 
> [...]

Here is the summary with links:
  - [net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init()
    https://git.kernel.org/netdev/net-next/c/e0665df8c501

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-10-23  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 14:02 [PATCH net-next] net: ti: icssg-prueth: Omit a variable reassignment in prueth_netdev_init() Markus Elfring
2025-10-20 15:51 ` Alexander Lobakin
2025-10-23  9: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).