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

diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c       Tue Feb 24 09:33:26 2004
+++ b/drivers/usb/host/uhci-hcd.c       Tue Feb 24 09:33:26 2004
@@ -1835,17 +1835,10 @@
 
 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);
-
-               tmp = tmp->next;
-               uhci_moveto_complete(uhci, urbp);
-       }
+       spin_lock(&uhci->complete_list_lock);
+       list_splice_init(&uhci->urb_remove_list, &uhci->complete_list);
+       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

Reply via email to