diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-03-05 11:01:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 16:20:36 -0700 |
commit | 7ea0a2bcfe40b1c525e63e931b7142ab22b64269 (patch) | |
tree | 90f5853d6a4685a00baf895eafe1098bb8e19f3c /drivers/usb/host/uhci-q.c | |
parent | 66760169492445395c530c812443f58e2cfdb3dc (diff) |
USB: uhci: don't use pseudo negative values
The code in uhci-q.c doesn't have to use pseudo-negative values. I did
it that way because it was easy and because it would give the expected
output during debugging. But it doesn't have to work that way. Here's
another approach.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r-- | drivers/usb/host/uhci-q.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index 58f873679145..3e5807d14ffb 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c @@ -899,8 +899,6 @@ static int uhci_submit_control(struct uhci_hcd *uhci, struct urb *urb, } if (qh->state != QH_STATE_ACTIVE) qh->skel = skel; - - urb->actual_length = -8; /* Account for the SETUP packet */ return 0; nomem: @@ -1494,11 +1492,10 @@ __acquires(uhci->lock) if (qh->type == USB_ENDPOINT_XFER_CONTROL) { - /* urb->actual_length < 0 means the setup transaction didn't - * complete successfully. Either it failed or the URB was - * unlinked first. Regardless, don't confuse people with a - * negative length. */ - urb->actual_length = max(urb->actual_length, 0); + /* Subtract off the length of the SETUP packet from + * urb->actual_length. + */ + urb->actual_length -= min_t(u32, 8, urb->actual_length); } /* When giving back the first URB in an Isochronous queue, |