From: Greg Kroah-Hartman Date: Thu, 30 Apr 2015 09:32:54 +0000 (+0200) Subject: USB: inode.c: move assignment out of if () block X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1ee7eead7071efc71f3dde214f215dfb820069e1;p=linux-beck.git 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 CC: Peter Chen Acked-by: Alan Stern CC: Andrzej Pietrasiewicz CC: Paul Bolle Signed-off-by: Greg Kroah-Hartman Reviewed-by: Felipe Balbi --- 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: