Skip to contentSkip to conversation

usb: gadget: fsl_udc_core: compress return logic into one line

PATCH New Gustavo A. R. Silva 1 participant 1 message Jul 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Simplify return logic to avoid unnecessary variable assignment.

This issue was detected using Coccinelle and the following semantic patch:

@@
local idexpression ret;
expression e;
@@

-ret =
+return

     e;

-return ret;

---
 drivers/usb/gadget/udc/fsl_udc_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/gadget/udc/fsl_udc_core.c +1 -2
index 6f2f71c..bf8ff5e 100644
@@ -1642,8 +1642,7 @@ static int process_ep_req(struct fsl_udc *udc, int pipe,
 		} else if (hc32_to_cpu(curr_td->size_ioc_sts)
 				& DTD_STATUS_ACTIVE) {
 			VDBG("Request not complete");
-			status = REQ_UNCOMPLETE;
-			return status;
+			return REQ_UNCOMPLETE;
 		} else if (remaining_length) {
 			if (direction) {
 				VDBG("Transmit dTD remaining length not zero");
Signature · 1 line
2.5.0