diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-07-11 11:21:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 16:50:13 -0700 |
commit | 2f5bb665ba7a14c5842fa2e1cde2be039843a2a2 (patch) | |
tree | 32a40c6858e39a56377b2964be5f90cda47bb801 /drivers/usb/host/ehci-hcd.c | |
parent | 99ac5b1e9536f142461681fa6143a947d66b4279 (diff) |
USB: EHCI: add pointer to end of async-unlink list
This patch (as1570) adds a pointer for the end of ehci-hcd's
async-unlink list. The list (which is actually a queue) is singly
linked, so having a pointer to its end makes adding new entries easier
-- there's no longer any need to scan through the whole list.
In principle it could be changed to a standard doubly-linked list. It
turns out that doing so actually makes the code less clear, so I'm
leaving it as is.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index efee426a246..8b75e4279a4 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1041,14 +1041,9 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) /* defer till later if busy */ if (ehci->async_unlink) { - struct ehci_qh *last; - - for (last = ehci->async_unlink; - last->unlink_next; - last = last->unlink_next) - continue; qh->qh_state = QH_STATE_UNLINK_WAIT; - last->unlink_next = qh; + ehci->async_unlink_last->unlink_next = qh; + ehci->async_unlink_last = qh; /* start IAA cycle */ } else |