lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3] usb: dwc3: host: remove dead code in dwc3_host_get_irq()
Date
According to the description of platform_get_irq()
* Return: non-zero IRQ number on success,
negative error number on failure.
and the code, platform_get_irq() will return -EINVAL
instead of IRQ0.

So platform_get_irq() no longer returns 0, there is no
need to check whether the return value is 0.

Found by Smatch:
drivers/usb/dwc3/host.c:60 dwc3_host_get_irq()
warn: platform_get_irq() does not return zero

Signed-off-by: Mingxuan Xiang <mx_xiang@hust.edu.cn>
---
v2->v3: remove curly braces
v1->v2: remove redundant goto
Only compile tested.
---
drivers/usb/dwc3/host.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f6f13e7f1ba1..61f57fe5bb78 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -52,13 +52,8 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
goto out;

irq = platform_get_irq(dwc3_pdev, 0);
- if (irq > 0) {
+ if (irq > 0)
dwc3_host_fill_xhci_irq_res(dwc, irq, NULL);
- goto out;
- }
-
- if (!irq)
- irq = -EINVAL;

out:
return irq;
--
2.39.2
\
 
 \ /
  Last update: 2023-03-27 01:16    [W:0.030 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site