Skip to contentSkip to conversation

net: lan966x: Do not check 0 for platform_get_irq_byname()

PATCH Applied Zhu Wang 4 participants 4 messages Aug 3, 2023 – Aug 4, 2023

Subsystems (3)

v1 of 3 Applied 1/1 Latest is v3 →

lore
Share & tools
lore

Zhu Wang

author
#0 lore raw

PATCH 1/1 net: lan966x: Do not check 0 for platform_get_irq_byname()

Since platform_get_irq_byname() never returned zero, so it need not to check whether it returned zero, it returned -EINVAL or -ENXIO when failed, so we replace the return error code with the result it returned.

---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_main.c +2 -2
index fbb0bb4594cd..824961ec1370 100644
@@ -1108,8 +1108,8 @@ static int lan966x_probe(struct platform_device *pdev)
 
 	/* set irq */
 	lan966x->xtr_irq = platform_get_irq_byname(pdev, "xtr");
-	if (lan966x->xtr_irq <= 0)
-		return -EINVAL;
+	if (lan966x->xtr_irq < 0)
+		return lan966x->xtr_irq;
 
 	err = devm_request_threaded_irq(&pdev->dev, lan966x->xtr_irq, NULL,
 					lan966x_xtr_irq_handler, IRQF_ONESHOT,
Signature · 1 line
2.17.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Zhu Wang

Since platform_get_irq_byname() never returned zero, so it need not to check whether it returned zero, it returned -EINVAL or -ENXIO when failed, so we replace the return error code with the result it returned.

For non-bugfix Networking patches, it is appropriate to designate the target tree as 'net-next' rather than '-next'. (For bug fixes 'net' is appropriate).

Otherwise, this looks fine to me.

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Zhu Wang
Quoted 9 lines · Zhu Wang

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Since platform_get_irq_byname() never returned zero, so it need not to check whether it returned zero, it returned -EINVAL or -ENXIO when failed, so we replace the return error code with the result it returned.

Quoted 22 lines
---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_main.c +2 -3
index fbb0bb4594cd..824961ec1370 100644
@@ -1108,8 +1108,8 @@ static int lan966x_probe(struct platform_device *pdev)
 
        /* set irq */
        lan966x->xtr_irq = platform_get_irq_byname(pdev, "xtr");
-       if (lan966x->xtr_irq <= 0)
-               return -EINVAL;
+       if (lan966x->xtr_irq < 0)
+               return lan966x->xtr_irq;
 
        err = devm_request_threaded_irq(&pdev->dev, lan966x->xtr_irq, NULL,
                                        lan966x_xtr_irq_handler, IRQF_ONESHOT,
--

2.17.1

Signature · 1 line
/Horatiu
#3 lore raw
In reply to Zhu Wang
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

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

Quoted 8 lines · On Thu, 3 Aug 2023 16:29:00 +0800 you wrote:

Since platform_get_irq_byname() never returned zero, so it need not to check whether it returned zero, it returned -EINVAL or -ENXIO when failed, so we replace the return error code with the result it returned.

---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
- [-next] net: lan966x: Do not check 0 for platform_get_irq_byname()

    https://git.kernel.org/netdev/net-next/c/86b7e033d684

You are awesome, thank you!

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