usb: gadget: fusb300_udc: compress return logic into one line
PATCH 1/1 usb: gadget: fusb300_udc: compress return logic into one line
Simplify return logic to avoid unnecessary variable declaration and assignment.
These issues were detected using Coccinelle and the following semantic patch:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- drivers/usb/gadget/udc/fusb300_udc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/usb/gadget/udc/fusb300_udc.c +2 -8
@@ -659,22 +659,16 @@ static void fusb300_rdfifo(struct fusb300_ep *ep,static u8 fusb300_get_epnstall (struct fusb300 *fusb300,u8 ep) { -u8 value;u32 reg =ioread32 (fusb300->reg +FUSB300_OFFSET_EPSET0 (ep)); - value = reg &FUSB300_EPSET0_STL ; - -return value; +return reg &FUSB300_EPSET0_STL ; }static u8 fusb300_get_cxstall (struct fusb300 *fusb300) { -u8 value;u32 reg =ioread32 (fusb300->reg +FUSB300_OFFSET_CSR ); - value = (reg &FUSB300_CSR_STL ) >>1 ; - -return value; +return (reg &FUSB300_CSR_STL ) >>1 ; }static void request_error (struct fusb300 *fusb300)
Signature · 1 line
2.5.0