Skip to contentSkip to conversation

usb: gadget: remove variable ret and remove unnecessary if statement

PATCH New Colin King 1 participant 1 message Sep 8, 2016 USB

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 usb: gadget: remove variable ret and remove unnecessary if statement

From: Colin Ian King <[email protected]>

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.

---
 drivers/usb/gadget/function/f_loopback.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/usb/gadget/function/f_loopback.c +2 -6
index ddb8c89..e700938 100644
@@ -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);
Signature · 1 line
2.9.3