Skip to contentSkip to conversation

usb: hub: remove assignment from if condition

PATCH New Kris Borer 1 participant 1 message Aug 11, 2015 USB

lore
Share & tools
lore

Kris Borer

author
#0 lore raw

PATCH 1/1 usb: hub: remove assignment from if condition

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>

---
 drivers/usb/core/hub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/hub.c +2 -2
index a0b22be..78bd0d6 100644
@@ -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);
 }
 
Signature · 1 line
1.9.1