]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: hub: remove assignment from if condition
authorKris Borer <kborer@gmail.com>
Tue, 11 Aug 2015 15:12:45 +0000 (11:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Aug 2015 23:54:02 +0000 (16:54 -0700)
Fix one occurrence of the checkpatch.pl error:

ERROR: do not use assignment in if condition

The semantic patch that makes this change is:

// <smpl>
@@
identifier i;
expression E, E2, E3;
statement S1, S2;
binary operator b;
@@

+ i = E;
  if (
- (i = E)
+ i
  b
  ... && E2 && E3 ) S1 else S2
// </smpl>

Signed-off-by: Kris Borer <kborer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c

index a0b22be1509d640bf85961ea0580819f2b4ee233..78bd0d671d9a14a7d5ef5e36f6fb2c6e36af9e7c 100644 (file)
@@ -671,8 +671,8 @@ resubmit:
        if (hub->quiescing)
                return;
 
-       if ((status = usb_submit_urb(hub->urb, GFP_ATOMIC)) != 0
-                       && status != -ENODEV && status != -EPERM)
+       status = usb_submit_urb(hub->urb, GFP_ATOMIC);
+       if (status != 0 && status != -ENODEV && status != -EPERM)
                dev_err(hub->intfdev, "resubmit --> %d\n", status);
 }