2021-12-24 05:18:20

by Jiasheng Jiang

[permalink] [raw]
Subject: [PATCH] net: ks8851: Fix wrong check for irq

Because netdev->irq is unsigned, the check is useless.
Therefore, we need to correct the check by using error variable.

Fixes: 99d7fbb5cedf ("net: ks8851: Check for error irq")
Signed-off-by: Jiasheng Jiang <[email protected]>
---
drivers/net/ethernet/micrel/ks8851_par.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ks8851_par.c b/drivers/net/ethernet/micrel/ks8851_par.c
index 7f49042484bd..2f3c67c35b18 100644
--- a/drivers/net/ethernet/micrel/ks8851_par.c
+++ b/drivers/net/ethernet/micrel/ks8851_par.c
@@ -320,9 +320,10 @@ static int ks8851_probe_par(struct platform_device *pdev)
if (ret)
return ret;

- netdev->irq = platform_get_irq(pdev, 0);
- if (netdev->irq < 0)
- return netdev->irq;
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
+ netdev->irq = ret;

return ks8851_probe_common(netdev, dev, msg_enable);
}
--
2.25.1



2021-12-24 23:01:24

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH] net: ks8851: Fix wrong check for irq

On Fri, 24 Dec 2021 13:17:53 +0800 Jiasheng Jiang wrote:
> Because netdev->irq is unsigned

It is not.