From db2c2b161d4a8f4a81e6f643848b1531517a67a5 Mon Sep 17 00:00:00 2001 From: Mingxuan Xiang Date: Fri, 24 Mar 2023 14:09:34 +0800 Subject: [PATCH] usb: dwc3: host: remove dead code in dwc3_host_get_irq() 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 Reviewed-by: Dan Carpenter Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230324060934.1686859-1-mx_xiang@hust.edu.cn Signed-off-by: Greg Kroah-Hartman --- 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 f6f13e7..61f57fe 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.7.4