lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Mar 2023 14:00:35 +0300
From:   Dan Carpenter <error27@...il.com>
To:     Mingxuan Xiang <mx_xiang@...t.edu.cn>,
        Sergey Shtylyov <s.shtylyov@....ru>
Cc:     Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        hust-os-kernel-patches@...glegroups.com,
        Dongliang Mu <dzm91@...t.edu.cn>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] usb: dwc3: host: remove dead code in
 dwc3_host_get_irq()

Here is how I would write that function, but I can't justify sending it
because it's just a matter of personal taste.

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f6f13e7f1ba1..fcc831ac3236 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -36,32 +36,28 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
 	irq = platform_get_irq_byname_optional(dwc3_pdev, "host");
 	if (irq > 0) {
 		dwc3_host_fill_xhci_irq_res(dwc, irq, "host");
-		goto out;
+		return irq;
 	}
 
 	if (irq == -EPROBE_DEFER)
-		goto out;
+		return -EPROBE_DEFER;
 
 	irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3");
 	if (irq > 0) {
 		dwc3_host_fill_xhci_irq_res(dwc, irq, "dwc_usb3");
-		goto out;
+		return irq;
 	}
 
 	if (irq == -EPROBE_DEFER)
-		goto out;
+		return -EPROBE_DEFER;
 
 	irq = platform_get_irq(dwc3_pdev, 0);
 	if (irq > 0) {
 		dwc3_host_fill_xhci_irq_res(dwc, irq, NULL);
-		goto out;
+		return irq;
 	}
 
-	if (!irq)
-		irq = -EINVAL;
-
-out:
-	return irq;
+	return -ENODEV;
 }
 
 int dwc3_host_init(struct dwc3 *dwc)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ