Skip to contentSkip to conversation

host-libusb: Correct test for USB packet state

PATCH In review Ed Maste 2 participants 3 messages May 7, 2013 – May 28, 2013

lore
Share & tools
lore

Ed Maste

author
#0 lore raw

PATCH 1/1 host-libusb: Correct test for USB packet state

USB_RET_ASYNC is -6, so inflight was always false.

---
 hw/usb/host-libusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/host-libusb.c +1 -1
index d1186b8..0af6ce3 100644
@@ -384,7 +384,7 @@ out:
 static void usb_host_req_abort(USBHostRequest *r)
 {
     USBHostDevice  *s = r->host;
-    bool inflight = (r->p && r->p->state == USB_RET_ASYNC);
+    bool inflight = (r->p && r->p->state == USB_PACKET_ASYNC);
 
     if (inflight) {
         r->p->status = USB_RET_NODEV;
Signature · 1 line
1.7.11.5
author
#1 lore raw
Quoted 1 line · Ed Maste

USB_RET_ASYNC is -6, so inflight was always false.

Ping. I believe the "if (inflight)" block in usb_host_req_abort() can never be executed in the current code.

Quoted 20 lines
---
 hw/usb/host-libusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/host-libusb.c +1 -2
index d1186b8..0af6ce3 100644
@@ -384,7 +384,7 @@ out:
 static void usb_host_req_abort(USBHostRequest *r)
 {
     USBHostDevice  *s = r->host;
-    bool inflight = (r->p && r->p->state == USB_RET_ASYNC);
+    bool inflight = (r->p && r->p->state == USB_PACKET_ASYNC);
 
     if (inflight) {
         r->p->status = USB_RET_NODEV;
--

1.7.11.5

#2 lore raw
Quoted 5 lines · Ed Maste
Quoted 1 line · Ed Maste

USB_RET_ASYNC is -6, so inflight was always false.

Ping. I believe the "if (inflight)" block in usb_host_req_abort() can never be executed in the current code.

Patch added to usb patch queue.

thanks,
Gerd