Skip to content

Commit

Permalink
USB: fix previous sparse fix which was incorrect
Browse files Browse the repository at this point in the history
The previous fix for a "sparse" warning in ehci_urb_dequeue() was
incorrect.  After rescheduling interrupt transfers it returned the
URB's completion status, not status for the dequeue operation itself.

This patch resolves that issue, cleans up the code in the reschedule
path, and shrinks the object code by a dozen bytes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Feb 21, 2008
1 parent 0cc5e2e commit e1a4914
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,18 +862,18 @@ static int ehci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
/* reschedule QH iff another request is queued */
if (!list_empty (&qh->qtd_list)
&& HC_IS_RUNNING (hcd->state)) {
int schedule_status;

schedule_status = qh_schedule (ehci, qh);
spin_unlock_irqrestore (&ehci->lock, flags);

if (schedule_status != 0) {
// shouldn't happen often, but ...
// FIXME kill those tds' urbs
err ("can't reschedule qh %p, err %d",
qh, schedule_status);
}
return status;
rc = qh_schedule(ehci, qh);

/* An error here likely indicates handshake failure
* or no space left in the schedule. Neither fault
* should happen often ...
*
* FIXME kill the now-dysfunctional queued urbs
*/
if (rc != 0)
ehci_err(ehci,
"can't reschedule qh %p, err %d",
qh, rc);
}
break;

Expand Down

0 comments on commit e1a4914

Please sign in to comment.