Skip to contentSkip to conversation

usb: gadget: compress return logic into one line

PATCH New Gustavo A. R. Silva 1 participant 1 message Jan 18, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: compress return logic into one line

Simplify return logic and avoid unnecessary variable assignment.

---
 drivers/usb/gadget/legacy/ncm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/gadget/legacy/ncm.c +2 -4
index fcee1ee0..8465f08 100644
@@ -102,10 +102,8 @@ static int ncm_do_config(struct usb_configuration *c)
 	}
 
 	f_ncm = usb_get_function(f_ncm_inst);
-	if (IS_ERR(f_ncm)) {
-		status = PTR_ERR(f_ncm);
-		return status;
-	}
+	if (IS_ERR(f_ncm))
+		return PTR_ERR(f_ncm);
 
 	status = usb_add_function(c, f_ncm);
 	if (status < 0) {