summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/legacy/inode.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 11:32:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 16:01:11 +0200
commit1ee7eead7071efc71f3dde214f215dfb820069e1 (patch)
treec1c0f18b59221fbca00542a07e377afbdbda3f00 /drivers/usb/gadget/legacy/inode.c
parentd544d273f398a40f71012cfd165dba6ef73690c9 (diff)
downloadlinux-1ee7eead7071efc71f3dde214f215dfb820069e1.tar.gz
linux-1ee7eead7071efc71f3dde214f215dfb820069e1.tar.bz2
linux-1ee7eead7071efc71f3dde214f215dfb820069e1.zip
USB: inode.c: move assignment out of if () block
We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. CC: Al Viro <viro@zeniv.linux.org.uk> CC: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> CC: Andrzej Pietrasiewicz <andrzej.p@samsung.com> CC: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/legacy/inode.c')
-rw-r--r--drivers/usb/gadget/legacy/inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 2030565c6789..f454c7af489c 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -769,9 +769,12 @@ ep_config (struct ep_data *data, const char *buf, size_t len)
if (data->dev->state == STATE_DEV_UNBOUND) {
value = -ENOENT;
goto gone;
- } else if ((ep = data->ep) == NULL) {
- value = -ENODEV;
- goto gone;
+ } else {
+ ep = data->ep;
+ if (ep == NULL) {
+ value = -ENODEV;
+ goto gone;
+ }
}
switch (data->dev->gadget->speed) {
case USB_SPEED_LOW: