This patch is from Stephen Hemminger. I modified it slightly to place the
new elements at the end of the complete_list instead of at the front.
On Tue, 24 Feb 2004, Stephen Hemminger wrote:
> Since the remove_list and complete_list now use the same element for
> linking, it is possible to use the list_splice inline to avoid
> having to loop over all the urb's
Greg, please apply.
Alan Stern
===== uhci-hcd.c 1.93 vs edited =====
--- 1.93/drivers/usb/host/uhci-hcd.c Tue Feb 24 10:17:58 2004
+++ edited/drivers/usb/host/uhci-hcd.c Thu Feb 26 12:13:44 2004
@@ -1852,17 +1852,12 @@
static void uhci_remove_pending_urbps(struct uhci_hcd *uhci)
{
- struct list_head *tmp, *head;
-
spin_lock(&uhci->urb_remove_list_lock);
- head = &uhci->urb_remove_list;
- tmp = head->next;
- while (tmp != head) {
- struct urb_priv *urbp = list_entry(tmp, struct urb_priv, urb_list);
+ spin_lock(&uhci->complete_list_lock);
- tmp = tmp->next;
- uhci_moveto_complete(uhci, urbp);
- }
+ /* Splice the urb_remove_list onto the end of the complete_list */
+ list_splice_init(&uhci->urb_remove_list, uhci->complete_list.prev);
+ spin_unlock(&uhci->complete_list_lock);
spin_unlock(&uhci->urb_remove_list_lock);
}
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel