diff mbox series

[-next] net: lan966x: Do not check 0 for platform_get_irq_byname()

Message ID 20230803082900.14921-1-wangzhu9@huawei.com (mailing list archive)
State Accepted
Commit 86b7e033d684a9d4ca20ad8e6f8b9300cf99668f
Delegated to: Netdev Maintainers
Headers show
Series [-next] net: lan966x: Do not check 0 for platform_get_irq_byname() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1328 this patch: 1328
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1351 this patch: 1351
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

wangzhu Aug. 3, 2023, 8:29 a.m. UTC
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.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Horman Aug. 3, 2023, 2:32 p.m. UTC | #1
On Thu, Aug 03, 2023 at 04:29:00PM +0800, Zhu Wang 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.
> 
> Signed-off-by: Zhu Wang <wangzhu9@huawei.com>

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

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

Otherwise, this looks fine to me.

Reviewed-by: Simon Horman <horms@kernel.org>
Horatiu Vultur Aug. 3, 2023, 7:41 p.m. UTC | #2
The 08/03/2023 16:29, Zhu Wang wrote:
> [Some people who received this message don't often get email from wangzhu9@huawei.com. 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.
> 
> Signed-off-by: Zhu Wang <wangzhu9@huawei.com>

Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>

> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> index fbb0bb4594cd..824961ec1370 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -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
>
patchwork-bot+netdevbpf@kernel.org Aug. 4, 2023, 10:20 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

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.
> 
> Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
> ---
>  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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index fbb0bb4594cd..824961ec1370 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -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,