Skip to contentSkip to conversation

xhci: drop unused wlength

PATCH New Gerd Hoffmann 1 participant 2 messages Sep 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xhci: drop unused wlength

---
 hw/usb/hcd-xhci.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
hw/usb/hcd-xhci.c +0 -2
index 2918e64..e0ca690 100644
@@ -1505,7 +1505,6 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
 {
     XHCITRB *trb_setup, *trb_status;
     uint8_t bmRequestType;
-    uint16_t wLength;
     int ret;
 
     trb_setup = &xfer->trbs[0];
@@ -1540,7 +1539,6 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
     }
 
     bmRequestType = trb_setup->parameter;
-    wLength = trb_setup->parameter >> 48;
 
     xfer->in_xfer = bmRequestType & USB_DIR_IN;
     xfer->iso_xfer = false;
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 usb-host: allow emulated (non-async) control requests without USBPacket

xhci needs this for USB_REQ_SET_ADDRESS due to the way usb addressing is handled by the xhci hardware.

---
 hw/usb/host-linux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/usb/host-linux.c +1 -1
index 8df9207..44f1a64 100644
@@ -1045,7 +1045,6 @@ static int usb_host_handle_control(USBDevice *dev, USBPacket *p,
 
     /* Note request is (bRequestType << 8) | bRequest */
     trace_usb_host_req_control(s->bus_num, s->addr, p, request, value, index);
-    assert(p->result == 0);
 
     switch (request) {
     case DeviceOutRequest | USB_REQ_SET_ADDRESS:
@@ -1074,6 +1073,7 @@ static int usb_host_handle_control(USBDevice *dev, USBPacket *p,
     }
 
     /* The rest are asynchronous */
+    assert(p && p->result == 0);
 
     if (length > sizeof(dev->data_buf)) {
         fprintf(stderr, "husb: ctrl buffer too small (%d > %zu)\n",
Signature · 1 line
1.7.1