]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: inode.c: move assignment out of if () block
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 09:32:54 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 14:01:11 +0000 (16:01 +0200)
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>
drivers/usb/gadget/legacy/inode.c

index 2030565c6789031af2a903df9e6e12b5053a293a..f454c7af489ce050dba446a1a5a6b292ad179644 100644 (file)
@@ -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: