On Wed, 29 Oct 2003, Greg KH wrote:

> Hm, looks like this patch does 3 different things, right?  Care to send
> 3 different patches?  :)

This is the second of three.  It changes spin_lock_save() to spin_lock() 
within the completion routine and list_del()/INIT_LIST_HEAD() to 
list_del_init().  It's nothing more than a minor optimization.

Alan Stern


===== hub.c 1.123 vs edited =====
--- 1.123/drivers/usb/core/hub.c        Mon Sep 22 12:37:50 2003
+++ edited/drivers/usb/core/hub.c       Wed Oct 29 15:51:32 2003
@@ -126,7 +126,6 @@
 static void hub_irq(struct urb *urb, struct pt_regs *regs)
 {
        struct usb_hub *hub = (struct usb_hub *)urb->context;
-       unsigned long flags;
        int status;
 
        switch (urb->status) {
@@ -151,12 +150,12 @@
        hub->nerrors = 0;
 
        /* Something happened, let khubd figure it out */
-       spin_lock_irqsave(&hub_event_lock, flags);
+       spin_lock(&hub_event_lock);
        if (list_empty(&hub->event_list)) {
                list_add(&hub->event_list, &hub_event_list);
                wake_up(&khubd_wait);
        }
-       spin_unlock_irqrestore(&hub_event_lock, flags);
+       spin_unlock(&hub_event_lock);
 
 resubmit:
        if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0
@@ -493,10 +492,8 @@
        spin_lock_irqsave(&hub_event_lock, flags);
 
        /* Delete it and then reset it */
-       list_del(&hub->event_list);
-       INIT_LIST_HEAD(&hub->event_list);
-       list_del(&hub->hub_list);
-       INIT_LIST_HEAD(&hub->hub_list);
+       list_del_init(&hub->event_list);
+       list_del_init(&hub->hub_list);
 
        spin_unlock_irqrestore(&hub_event_lock, flags);
 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to