Commit 992510f3 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Greg Kroah-Hartman

usb: isp1760: 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;
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5771a8c0
...@@ -396,7 +396,6 @@ static int handshake(struct usb_hcd *hcd, u32 reg, ...@@ -396,7 +396,6 @@ static int handshake(struct usb_hcd *hcd, u32 reg,
/* reset a non-running (STS_HALT == 1) controller */ /* reset a non-running (STS_HALT == 1) controller */
static int ehci_reset(struct usb_hcd *hcd) static int ehci_reset(struct usb_hcd *hcd)
{ {
int retval;
struct isp1760_hcd *priv = hcd_to_priv(hcd); struct isp1760_hcd *priv = hcd_to_priv(hcd);
u32 command = reg_read32(hcd->regs, HC_USBCMD); u32 command = reg_read32(hcd->regs, HC_USBCMD);
...@@ -405,9 +404,8 @@ static int ehci_reset(struct usb_hcd *hcd) ...@@ -405,9 +404,8 @@ static int ehci_reset(struct usb_hcd *hcd)
reg_write32(hcd->regs, HC_USBCMD, command); reg_write32(hcd->regs, HC_USBCMD, command);
hcd->state = HC_STATE_HALT; hcd->state = HC_STATE_HALT;
priv->next_statechange = jiffies; priv->next_statechange = jiffies;
retval = handshake(hcd, HC_USBCMD,
CMD_RESET, 0, 250 * 1000); return handshake(hcd, HC_USBCMD, CMD_RESET, 0, 250 * 1000);
return retval;
} }
static struct isp1760_qh *qh_alloc(gfp_t flags) static struct isp1760_qh *qh_alloc(gfp_t flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment