diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2013-03-22 13:31:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 16:35:05 -0400 |
commit | 6e018751a35f6ef7ad04eb8006b5886b6a7c47f5 (patch) | |
tree | e1dde22b7aa1ac3566ebbbd29b78df611e05c572 /drivers/usb/host/ehci.h | |
parent | 7655e3160c78a18c2ecf7bf4dee0bbfe58575c7f (diff) |
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r-- | drivers/usb/host/ehci.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 6815209511aa..13f67041502e 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -128,9 +128,8 @@ struct ehci_hcd { /* one per controller */ | |||
128 | /* async schedule support */ | 128 | /* async schedule support */ |
129 | struct ehci_qh *async; | 129 | struct ehci_qh *async; |
130 | struct ehci_qh *dummy; /* For AMD quirk use */ | 130 | struct ehci_qh *dummy; /* For AMD quirk use */ |
131 | struct ehci_qh *async_unlink; | 131 | struct list_head async_unlink; |
132 | struct ehci_qh *async_unlink_last; | 132 | struct list_head async_iaa; |
133 | struct ehci_qh *async_iaa; | ||
134 | unsigned async_unlink_cycle; | 133 | unsigned async_unlink_cycle; |
135 | unsigned async_count; /* async activity count */ | 134 | unsigned async_count; /* async activity count */ |
136 | 135 | ||
@@ -143,8 +142,7 @@ struct ehci_hcd { /* one per controller */ | |||
143 | unsigned i_thresh; /* uframes HC might cache */ | 142 | unsigned i_thresh; /* uframes HC might cache */ |
144 | 143 | ||
145 | union ehci_shadow *pshadow; /* mirror hw periodic table */ | 144 | union ehci_shadow *pshadow; /* mirror hw periodic table */ |
146 | struct ehci_qh *intr_unlink; | 145 | struct list_head intr_unlink; |
147 | struct ehci_qh *intr_unlink_last; | ||
148 | unsigned intr_unlink_cycle; | 146 | unsigned intr_unlink_cycle; |
149 | unsigned now_frame; /* frame from HC hardware */ | 147 | unsigned now_frame; /* frame from HC hardware */ |
150 | unsigned last_iso_frame; /* last frame scanned for iso */ | 148 | unsigned last_iso_frame; /* last frame scanned for iso */ |
@@ -380,7 +378,7 @@ struct ehci_qh { | |||
380 | struct list_head qtd_list; /* sw qtd list */ | 378 | struct list_head qtd_list; /* sw qtd list */ |
381 | struct list_head intr_node; /* list of intr QHs */ | 379 | struct list_head intr_node; /* list of intr QHs */ |
382 | struct ehci_qtd *dummy; | 380 | struct ehci_qtd *dummy; |
383 | struct ehci_qh *unlink_next; /* next on unlink list */ | 381 | struct list_head unlink_node; |
384 | 382 | ||
385 | unsigned unlink_cycle; | 383 | unsigned unlink_cycle; |
386 | 384 | ||