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>] [day] [month] [year] [list]
Date:   Thu,  8 Sep 2016 21:09:30 +0100
From:   Colin King <colin.king@...onical.com>
To:     Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Krzysztof Opasiak <k.opasiak@...sung.com>,
        Robert Baldyga <r.baldyga@...sung.com>,
        Peter Chen <peter.chen@...escale.com>,
        John Youn <John.Youn@...opsys.com>,
        "Felipe F . Tonello" <eu@...ipetonello.com>,
        linux-usb@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] usb: gadget: remove variable ret and remove unnecessary if statement

From: Colin Ian King <colin.king@...onical.com>

the if statement in lb_modinit is unnecessary so we can totally
remove the variable ret and just return the return value from
the call to usb_function_register.

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/usb/gadget/function/f_loopback.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c
index ddb8c89..e700938 100644
--- a/drivers/usb/gadget/function/f_loopback.c
+++ b/drivers/usb/gadget/function/f_loopback.c
@@ -591,13 +591,9 @@ DECLARE_USB_FUNCTION(Loopback, loopback_alloc_instance, loopback_alloc);
 
 int __init lb_modinit(void)
 {
-	int ret;
-
-	ret = usb_function_register(&Loopbackusb_func);
-	if (ret)
-		return ret;
-	return ret;
+	return usb_function_register(&Loopbackusb_func);
 }
+
 void __exit lb_modexit(void)
 {
 	usb_function_unregister(&Loopbackusb_func);
-- 
2.9.3

Powered by blists - more mailing lists