# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.454 -> 1.455 # drivers/usb/serial/ipaq.c 1.10 -> 1.11 # drivers/usb/core/devio.c 1.26 -> 1.27 # drivers/usb/host/hc_simple.c 1.1 -> 1.2 # drivers/usb/media/dabusb.c 1.18 -> 1.19 # drivers/usb/host/uhci.c 1.45 -> 1.46 # drivers/usb/host/uhci-hcd.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/06/11 patch@luckynet.dynu.com 1.455 # [PATCH] new list macros for USB # # This is a collected patch for USB drivers to use the new list macros # (list_del_init, list_move*). # -------------------------------------------- # diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c --- a/drivers/usb/core/devio.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/core/devio.c Tue Jun 11 14:58:41 2002 @@ -215,8 +215,7 @@ unsigned long flags; spin_lock_irqsave(&ps->lock, flags); - list_del(&as->asynclist); - INIT_LIST_HEAD(&as->asynclist); + list_del_init(&as->asynclist); spin_unlock_irqrestore(&ps->lock, flags); } @@ -228,8 +227,7 @@ spin_lock_irqsave(&ps->lock, flags); if (!list_empty(&ps->async_completed)) { as = list_entry(ps->async_completed.next, struct async, asynclist); - list_del(&as->asynclist); - INIT_LIST_HEAD(&as->asynclist); + list_del_init(&as->asynclist); } spin_unlock_irqrestore(&ps->lock, flags); return as; @@ -247,8 +245,7 @@ p = p->next; if (as->userurb != userurb) continue; - list_del(&as->asynclist); - INIT_LIST_HEAD(&as->asynclist); + list_del_init(&as->asynclist); spin_unlock_irqrestore(&ps->lock, flags); return as; } @@ -263,8 +260,7 @@ struct siginfo sinfo; spin_lock(&ps->lock); - list_del(&as->asynclist); - list_add_tail(&as->asynclist, &ps->async_completed); + list_move_tail(&as->asynclist, &ps->async_completed); spin_unlock(&ps->lock); wake_up(&ps->wait); if (as->signr) { @@ -284,8 +280,7 @@ spin_lock_irqsave(&ps->lock, flags); while (!list_empty(&ps->async_pending)) { as = list_entry(ps->async_pending.next, struct async, asynclist); - list_del(&as->asynclist); - INIT_LIST_HEAD(&as->asynclist); + list_del_init(&as->asynclist); spin_unlock_irqrestore(&ps->lock, flags); /* usb_unlink_urb calls the completion handler with status == -ENOENT */ usb_unlink_urb(as->urb); @@ -528,8 +523,8 @@ unsigned int i; lock_kernel(); - list_del(&ps->list); - INIT_LIST_HEAD(&ps->list); + list_del_init(&ps->list); + if (ps->dev) { for (i = 0; ps->ifclaimed && i < 8*sizeof(ps->ifclaimed); i++) if (test_bit(i, &ps->ifclaimed)) diff -Nru a/drivers/usb/host/hc_simple.c b/drivers/usb/host/hc_simple.c --- a/drivers/usb/host/hc_simple.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/host/hc_simple.c Tue Jun 11 14:58:41 2002 @@ -220,14 +220,12 @@ /* URB active? */ if (urb->transfer_flags & (USB_ASYNC_UNLINK | USB_TIMEOUT_KILLED)) { - /* asynchron with callback */ - - list_del (&urb->urb_list); /* relink the urb to the del list */ - list_add (&urb->urb_list, &hci->del_list); + /* asynchronous with callback */ + /* relink the urb to the del list */ + list_move (&urb->urb_list, &hci->del_list); spin_unlock_irqrestore (&usb_urb_lock, flags); - } else { - /* synchron without callback */ + /* synchronous without callback */ add_wait_queue (&hci->waitq, &wait); @@ -235,8 +233,8 @@ comp = urb->complete; urb->complete = NULL; - list_del (&urb->urb_list); /* relink the urb to the del list */ - list_add (&urb->urb_list, &hci->del_list); + /* relink the urb to the del list */ + list_move(&urb->urb_list, &hci->del_list); spin_unlock_irqrestore (&usb_urb_lock, flags); @@ -560,10 +558,9 @@ epd_t *ed = &hci_dev->ed[qu_pipeindex (urb->pipe)]; DBGFUNC ("enter qu_next_urb\n"); - list_del (&urb->urb_list); - INIT_LIST_HEAD (&urb->urb_list); - if (ed->pipe_head == urb) { + list_del_init(&urb->urb_list); + if (ed->pipe_head == urb) { #ifdef HC_URB_TIMEOUT if (urb->timeout) del_timer (&ed->timeout); @@ -574,8 +571,7 @@ if (!list_empty (&ed->urb_queue)) { urb = list_entry (ed->urb_queue.next, struct urb, urb_list); - list_del (&urb->urb_list); - INIT_LIST_HEAD (&urb->urb_list); + list_del_init (&urb->urb_list); ed->pipe_head = urb; qu_queue_active_urb (hci, urb, ed); } else { @@ -756,8 +752,7 @@ * only when the new SOF happens */ lh = hci->bulk_list.next; - list_del (&hci->bulk_list); - list_add (&hci->bulk_list, lh); + list_move (&hci->bulk_list, lh); } return 0; } diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/host/uhci-hcd.c Tue Jun 11 14:58:41 2002 @@ -1773,10 +1773,8 @@ uhci_fsbr_timeout(uhci, u); /* Check if the URB timed out */ - if (u->timeout && time_after_eq(jiffies, up->inserttime + u->timeout)) { - list_del(&up->urb_list); - list_add_tail(&up->urb_list, &list); - } + if (u->timeout && time_after_eq(jiffies, up->inserttime + u->timeout)) + list_move_tail(&up->urb_list, &list); spin_unlock(&u->lock); } diff -Nru a/drivers/usb/host/uhci.c b/drivers/usb/host/uhci.c --- a/drivers/usb/host/uhci.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/host/uhci.c Tue Jun 11 14:58:41 2002 @@ -2008,10 +2008,8 @@ uhci_fsbr_timeout(uhci, u); /* Check if the URB timed out */ - if (u->timeout && time_after_eq(jiffies, up->inserttime + u->timeout)) { - list_del(&u->urb_list); - list_add_tail(&u->urb_list, &list); - } + if (u->timeout && time_after_eq(jiffies, up->inserttime + u->timeout)) + list_move_tail(&u->urb_list, &list); spin_unlock(&u->lock); } diff -Nru a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c --- a/drivers/usb/media/dabusb.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/media/dabusb.c Tue Jun 11 14:58:41 2002 @@ -80,8 +80,7 @@ goto err; } tmp = src->next; - list_del (tmp); - list_add_tail (tmp, dst); + list_move_tail (tmp, dst); err: spin_unlock_irqrestore (&s->lock, flags); return ret; diff -Nru a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c --- a/drivers/usb/serial/ipaq.c Tue Jun 11 14:58:41 2002 +++ b/drivers/usb/serial/ipaq.c Tue Jun 11 14:58:41 2002 @@ -401,8 +401,7 @@ pkt->written += count; priv->queue_len -= count; if (pkt->written == pkt->len) { - list_del(&pkt->list); - list_add(&pkt->list, &priv->freelist); + list_move(&pkt->list, &priv->freelist); priv->free_len += PACKET_SIZE; } if (room == 0) {