netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fjes: Fix wrong check for irq
@ 2021-12-24  3:55 Jiasheng Jiang
  2021-12-24 23:02 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2021-12-24  3:55 UTC (permalink / raw)
  To: davem, kuba, thunder.leizhen, yangyingliang
  Cc: netdev, linux-kernel, Jiasheng Jiang

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 <jiasheng@iscas.ac.cn>
---
 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


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

* Re: [PATCH] fjes: Fix wrong check for irq
  2021-12-24  3:55 [PATCH] fjes: Fix wrong check for irq Jiasheng Jiang
@ 2021-12-24 23:02 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2021-12-24 23:02 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: davem, thunder.leizhen, yangyingliang, netdev, linux-kernel

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

It is not.

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

end of thread, other threads:[~2021-12-24 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  3:55 [PATCH] fjes: Fix wrong check for irq Jiasheng Jiang
2021-12-24 23:02 ` Jakub Kicinski

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