2021-12-24 03:56:07

by Jiasheng Jiang

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

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

Fixes: db6d6afe382d ("fjes: Check for error irq")
Signed-off-by: Jiasheng Jiang <[email protected]>
---
drivers/net/fjes/fjes_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index ebd287039a54..70fbe40a598c 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1261,11 +1261,11 @@ static int fjes_probe(struct platform_device *plat_dev)
}
hw->hw_res.start = res->start;
hw->hw_res.size = resource_size(res);
- hw->hw_res.irq = platform_get_irq(plat_dev, 0);
- if (hw->hw_res.irq < 0) {
- err = hw->hw_res.irq;
+
+ err = platform_get_irq(plat_dev, 0);
+ if (err < 0)
goto err_free_control_wq;
- }
+ hw->hw_res.irq = err;

err = fjes_hw_init(&adapter->hw);
if (err)
--
2.25.1



2021-12-24 23:02:49

by Jakub Kicinski

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

On Fri, 24 Dec 2021 11:55:39 +0800 Jiasheng Jiang wrote:
> Because hw->hw_res.irq is unsigned

It is not.