From 2f5bb665ba7a14c5842fa2e1cde2be039843a2a2 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Wed, 11 Jul 2012 11:21:43 -0400 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-q.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/usb/host/ehci-q.c') diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 8e80cde8c35e..5193612c96ea 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c @@ -1227,6 +1227,8 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) qh->qh_state = QH_STATE_UNLINK; ehci->async_unlink = qh; + if (!qh->unlink_next) + ehci->async_unlink_last = qh; prev = ehci->async; while (prev->qh_next.qh != qh) -- cgit v1.2.3