Skip to contentSkip to conversation

USB: devio: fix a condition in async_completed()

PATCH In review Dan Carpenter 2 participants 2 messages May 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: devio: fix a condition in async_completed()

Static checkers complain that the current condition is never true. It seems pretty likely that it's a typo and "URB" was intended instead of "USB".

Fixes 3d97ff63f899 ('usbdevfs: Use scatter-gather lists for large bulk transfers')
drivers/usb/core/devio.c +1 -1
index 4b0448c..986abde 100644
@@ -513,7 +513,7 @@ static void async_completed(struct urb *urb)
 	snoop(&urb->dev->dev, "urb complete\n");
 	snoop_urb(urb->dev, as->userurb, urb->pipe, urb->actual_length,
 			as->status, COMPLETE, NULL, 0);
-	if ((urb->transfer_flags & URB_DIR_MASK) = USB_DIR_IN)
+	if ((urb->transfer_flags & URB_DIR_MASK) = URB_DIR_IN)
 		snoop_urb_data(urb, urb->actual_length);
 
 	if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET &&
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Dan Carpenter

Static checkers complain that the current condition is never true. It seems pretty likely that it's a typo and "URB" was intended instead of "USB".

Fixes 3d97ff63f899 ('usbdevfs: Use scatter-gather lists for large bulk transfers')
drivers/usb/core/devio.c +0 -0
index 4b0448c..986abde 100644

drivers/usb/core/devio.c static void async_completed(struct urb *urb) · line 519

Quoted 8 lines
drivers/usb/core/devio.c +1 -1
@@ -513,7 +513,7 @@ static void async_completed(struct urb *urb)
 	snoop(&urb->dev->dev, "urb complete\n");
 	snoop_urb(urb->dev, as->userurb, urb->pipe, urb->actual_length,
 			as->status, COMPLETE, NULL, 0);
-	if ((urb->transfer_flags & URB_DIR_MASK) = USB_DIR_IN)
+	if ((urb->transfer_flags & URB_DIR_MASK) = URB_DIR_IN)
 		snoop_urb_data(urb, urb->actual_length);
 
 	if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET &&

Yes, this most certainly is a typo. Or rather, it is a copy of a typo originally introduced in commit 0880aef49e40 (USB: usbfs_snoop: add data logging back in).