From 6e018751a35f6ef7ad04eb8006b5886b6a7c47f5 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 22 Mar 2013 13:31:45 -0400 Subject: USB: EHCI: convert singly-linked lists to list_heads This patch (as1664) converts ehci-hcd's async_unlink, async_iaa, and intr_unlink from singly-linked lists to standard doubly-linked list_heads. Originally it didn't seem necessary to use list_heads, because items are always added to and removed from these lists in FIFO order. But now with more list processing going on, it's easier to use the standard routines than continue with a roll-your-own approach. I don't know if the code ends up being notably shorter, but the patterns will be more familiar to any kernel hacker. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-sched.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/usb/host/ehci-sched.c') diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index e7a2dbd27b1e..c833febf8df0 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -620,17 +620,13 @@ static void start_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) qh->unlink_cycle = ehci->intr_unlink_cycle; /* New entries go at the end of the intr_unlink list */ - if (ehci->intr_unlink) - ehci->intr_unlink_last->unlink_next = qh; - else - ehci->intr_unlink = qh; - ehci->intr_unlink_last = qh; + list_add_tail(&qh->unlink_node, &ehci->intr_unlink); if (ehci->intr_unlinking) ; /* Avoid recursive calls */ else if (ehci->rh_state < EHCI_RH_RUNNING) ehci_handle_intr_unlinks(ehci); - else if (ehci->intr_unlink == qh) { + else if (ehci->intr_unlink.next == &qh->unlink_node) { ehci_enable_event(ehci, EHCI_HRTIMER_UNLINK_INTR, true); ++ehci->intr_unlink_cycle; } -- cgit v1.2.3