diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-06-26 03:24:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:18 -0400 |
commit | 179e09172ab663b8587ecc46bb18a56a770304a9 (patch) | |
tree | 4d57324584c43f81ac2a6d258bb46e75fb6b4327 /drivers | |
parent | a842ef297fd91b1b93f2aa5898d2efd19e95f6a5 (diff) |
[PATCH] drivers: use list_move()
This patch converts the combination of list_del(A) and list_add(A, B) to
list_move(A, B) under drivers/.
Acked-by: Corey Minyard <minyard@mvista.com>
Cc: Ben Collins <bcollins@debian.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Cc: Alasdair Kergon <dm-devel@redhat.com>
Cc: Gerd Knorr <kraxel@bytesex.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frank Pavlic <fpavlic@de.ibm.com>
Acked-by: Matthew Wilcox <matthew@wil.cx>
Cc: Andrew Vasquez <linux-driver@qlogic.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 7 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.c | 3 | ||||
-rw-r--r-- | drivers/ieee1394/raw1394.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/core/mad.c | 9 | ||||
-rw-r--r-- | drivers/infiniband/core/mad_rmpp.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 6 | ||||
-rw-r--r-- | drivers/md/dm-raid1.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 6 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 7 | ||||
-rw-r--r-- | drivers/scsi/ncr53c8xx.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/hc_crisv10.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 19 |
14 files changed, 28 insertions, 53 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 9f2f8fdec69a..23028559dbc4 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -936,11 +936,8 @@ int ipmi_set_gets_events(ipmi_user_t user, int val) | |||
936 | 936 | ||
937 | if (val) { | 937 | if (val) { |
938 | /* Deliver any queued events. */ | 938 | /* Deliver any queued events. */ |
939 | list_for_each_entry_safe(msg, msg2, &intf->waiting_events, | 939 | list_for_each_entry_safe(msg, msg2, &intf->waiting_events, link) |
940 | link) { | 940 | list_move_tail(&msg->link, &msgs); |
941 | list_del(&msg->link); | ||
942 | list_add_tail(&msg->link, &msgs); | ||
943 | } | ||
944 | intf->waiting_events_count = 0; | 941 | intf->waiting_events_count = 0; |
945 | } | 942 | } |
946 | 943 | ||
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 5bda15904a08..2d5b57be98c3 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -1074,8 +1074,7 @@ static inline int update_partial_datagram(struct list_head *pdgl, struct list_he | |||
1074 | 1074 | ||
1075 | /* Move list entry to beginnig of list so that oldest partial | 1075 | /* Move list entry to beginnig of list so that oldest partial |
1076 | * datagrams percolate to the end of the list */ | 1076 | * datagrams percolate to the end of the list */ |
1077 | list_del(lh); | 1077 | list_move(lh, pdgl); |
1078 | list_add(lh, pdgl); | ||
1079 | 1078 | ||
1080 | return 0; | 1079 | return 0; |
1081 | } | 1080 | } |
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index 20ce539580f1..571ea68c0cf2 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c | |||
@@ -132,8 +132,7 @@ static void free_pending_request(struct pending_request *req) | |||
132 | static void __queue_complete_req(struct pending_request *req) | 132 | static void __queue_complete_req(struct pending_request *req) |
133 | { | 133 | { |
134 | struct file_info *fi = req->file_info; | 134 | struct file_info *fi = req->file_info; |
135 | list_del(&req->list); | 135 | list_move_tail(&req->list, &fi->req_complete); |
136 | list_add_tail(&req->list, &fi->req_complete); | ||
137 | 136 | ||
138 | up(&fi->complete_sem); | 137 | up(&fi->complete_sem); |
139 | wake_up_interruptible(&fi->poll_wait_complete); | 138 | wake_up_interruptible(&fi->poll_wait_complete); |
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index b38e02a5db35..5ed4dab52a6f 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -1775,11 +1775,9 @@ ib_find_send_mad(struct ib_mad_agent_private *mad_agent_priv, | |||
1775 | void ib_mark_mad_done(struct ib_mad_send_wr_private *mad_send_wr) | 1775 | void ib_mark_mad_done(struct ib_mad_send_wr_private *mad_send_wr) |
1776 | { | 1776 | { |
1777 | mad_send_wr->timeout = 0; | 1777 | mad_send_wr->timeout = 0; |
1778 | if (mad_send_wr->refcount == 1) { | 1778 | if (mad_send_wr->refcount == 1) |
1779 | list_del(&mad_send_wr->agent_list); | 1779 | list_move_tail(&mad_send_wr->agent_list, |
1780 | list_add_tail(&mad_send_wr->agent_list, | ||
1781 | &mad_send_wr->mad_agent_priv->done_list); | 1780 | &mad_send_wr->mad_agent_priv->done_list); |
1782 | } | ||
1783 | } | 1781 | } |
1784 | 1782 | ||
1785 | static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, | 1783 | static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, |
@@ -2098,8 +2096,7 @@ retry: | |||
2098 | queued_send_wr = container_of(mad_list, | 2096 | queued_send_wr = container_of(mad_list, |
2099 | struct ib_mad_send_wr_private, | 2097 | struct ib_mad_send_wr_private, |
2100 | mad_list); | 2098 | mad_list); |
2101 | list_del(&mad_list->list); | 2099 | list_move_tail(&mad_list->list, &send_queue->list); |
2102 | list_add_tail(&mad_list->list, &send_queue->list); | ||
2103 | } | 2100 | } |
2104 | spin_unlock_irqrestore(&send_queue->lock, flags); | 2101 | spin_unlock_irqrestore(&send_queue->lock, flags); |
2105 | 2102 | ||
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index d4704e054e30..ebcd5b181770 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -665,8 +665,7 @@ static void process_rmpp_ack(struct ib_mad_agent_private *agent, | |||
665 | goto out; | 665 | goto out; |
666 | 666 | ||
667 | mad_send_wr->refcount++; | 667 | mad_send_wr->refcount++; |
668 | list_del(&mad_send_wr->agent_list); | 668 | list_move_tail(&mad_send_wr->agent_list, |
669 | list_add_tail(&mad_send_wr->agent_list, | ||
670 | &mad_send_wr->mad_agent_priv->send_list); | 669 | &mad_send_wr->mad_agent_priv->send_list); |
671 | } | 670 | } |
672 | out: | 671 | out: |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 216471fa01cc..ab40488182b3 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -864,8 +864,7 @@ void ipoib_mcast_restart_task(void *dev_ptr) | |||
864 | 864 | ||
865 | if (mcast) { | 865 | if (mcast) { |
866 | /* Destroy the send only entry */ | 866 | /* Destroy the send only entry */ |
867 | list_del(&mcast->list); | 867 | list_move_tail(&mcast->list, &remove_list); |
868 | list_add_tail(&mcast->list, &remove_list); | ||
869 | 868 | ||
870 | rb_replace_node(&mcast->rb_node, | 869 | rb_replace_node(&mcast->rb_node, |
871 | &nmcast->rb_node, | 870 | &nmcast->rb_node, |
@@ -890,8 +889,7 @@ void ipoib_mcast_restart_task(void *dev_ptr) | |||
890 | rb_erase(&mcast->rb_node, &priv->multicast_tree); | 889 | rb_erase(&mcast->rb_node, &priv->multicast_tree); |
891 | 890 | ||
892 | /* Move to the remove list */ | 891 | /* Move to the remove list */ |
893 | list_del(&mcast->list); | 892 | list_move_tail(&mcast->list, &remove_list); |
894 | list_add_tail(&mcast->list, &remove_list); | ||
895 | } | 893 | } |
896 | } | 894 | } |
897 | 895 | ||
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index d12cf3e5e076..4ad269e66525 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -458,11 +458,9 @@ static int __rh_recovery_prepare(struct region_hash *rh) | |||
458 | /* Already quiesced ? */ | 458 | /* Already quiesced ? */ |
459 | if (atomic_read(®->pending)) | 459 | if (atomic_read(®->pending)) |
460 | list_del_init(®->list); | 460 | list_del_init(®->list); |
461 | else | ||
462 | list_move(®->list, &rh->quiesced_regions); | ||
461 | 463 | ||
462 | else { | ||
463 | list_del_init(®->list); | ||
464 | list_add(®->list, &rh->quiesced_regions); | ||
465 | } | ||
466 | spin_unlock_irq(&rh->region_lock); | 464 | spin_unlock_irq(&rh->region_lock); |
467 | 465 | ||
468 | return 1; | 466 | return 1; |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 694d1d80ff3f..dcda5291b990 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -494,8 +494,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
494 | return 0; | 494 | return 0; |
495 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); | 495 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); |
496 | if (NULL == prev) { | 496 | if (NULL == prev) { |
497 | list_del(&buf->vb.queue); | 497 | list_move_tail(&buf->vb.queue, &q->active); |
498 | list_add_tail(&buf->vb.queue,&q->active); | ||
499 | start_video_dma(dev, q, buf); | 498 | start_video_dma(dev, q, buf); |
500 | buf->vb.state = STATE_ACTIVE; | 499 | buf->vb.state = STATE_ACTIVE; |
501 | buf->count = q->count++; | 500 | buf->count = q->count++; |
@@ -506,8 +505,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
506 | } else if (prev->vb.width == buf->vb.width && | 505 | } else if (prev->vb.width == buf->vb.width && |
507 | prev->vb.height == buf->vb.height && | 506 | prev->vb.height == buf->vb.height && |
508 | prev->fmt == buf->fmt) { | 507 | prev->fmt == buf->fmt) { |
509 | list_del(&buf->vb.queue); | 508 | list_move_tail(&buf->vb.queue, &q->active); |
510 | list_add_tail(&buf->vb.queue,&q->active); | ||
511 | buf->vb.state = STATE_ACTIVE; | 509 | buf->vb.state = STATE_ACTIVE; |
512 | buf->count = q->count++; | 510 | buf->count = q->count++; |
513 | prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); | 511 | prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 01cd8ec751ea..d643a097faa5 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -2578,8 +2578,7 @@ ppp_find_channel(int unit) | |||
2578 | 2578 | ||
2579 | list_for_each_entry(pch, &new_channels, list) { | 2579 | list_for_each_entry(pch, &new_channels, list) { |
2580 | if (pch->file.index == unit) { | 2580 | if (pch->file.index == unit) { |
2581 | list_del(&pch->list); | 2581 | list_move(&pch->list, &all_channels); |
2582 | list_add(&pch->list, &all_channels); | ||
2583 | return pch; | 2582 | return pch; |
2584 | } | 2583 | } |
2585 | } | 2584 | } |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index f94419b334f7..2eded55ae88d 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1140,10 +1140,9 @@ list_modified: | |||
1140 | } | 1140 | } |
1141 | } | 1141 | } |
1142 | /* re-insert all entries from the failed_list into ipm_list */ | 1142 | /* re-insert all entries from the failed_list into ipm_list */ |
1143 | list_for_each_entry_safe(ipm, tmp, &failed_list, list) { | 1143 | list_for_each_entry_safe(ipm, tmp, &failed_list, list) |
1144 | list_del_init(&ipm->list); | 1144 | list_move_tail(&ipm->list, &card->ipm_list); |
1145 | list_add_tail(&ipm->list, &card->ipm_list); | 1145 | |
1146 | } | ||
1147 | spin_unlock_irqrestore(&card->ipm_lock, flags); | 1146 | spin_unlock_irqrestore(&card->ipm_lock, flags); |
1148 | } | 1147 | } |
1149 | 1148 | ||
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 6ab035590ee6..b28712df0b77 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
@@ -5118,8 +5118,7 @@ static void ncr_ccb_skipped(struct ncb *np, struct ccb *cp) | |||
5118 | cp->host_status &= ~HS_SKIPMASK; | 5118 | cp->host_status &= ~HS_SKIPMASK; |
5119 | cp->start.schedule.l_paddr = | 5119 | cp->start.schedule.l_paddr = |
5120 | cpu_to_scr(NCB_SCRIPT_PHYS (np, select)); | 5120 | cpu_to_scr(NCB_SCRIPT_PHYS (np, select)); |
5121 | list_del(&cp->link_ccbq); | 5121 | list_move_tail(&cp->link_ccbq, &lp->skip_ccbq); |
5122 | list_add_tail(&cp->link_ccbq, &lp->skip_ccbq); | ||
5123 | if (cp->queued) { | 5122 | if (cp->queued) { |
5124 | --lp->queuedccbs; | 5123 | --lp->queuedccbs; |
5125 | } | 5124 | } |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index aef093db597e..3d4487eac9b7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2258,8 +2258,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha) | |||
2258 | } | 2258 | } |
2259 | 2259 | ||
2260 | /* Remove device from the new list and add it to DB */ | 2260 | /* Remove device from the new list and add it to DB */ |
2261 | list_del(&fcport->list); | 2261 | list_move_tail(&fcport->list, &ha->fcports); |
2262 | list_add_tail(&fcport->list, &ha->fcports); | ||
2263 | 2262 | ||
2264 | /* Login and update database */ | 2263 | /* Login and update database */ |
2265 | qla2x00_fabric_dev_login(ha, fcport, &next_loopid); | 2264 | qla2x00_fabric_dev_login(ha, fcport, &next_loopid); |
diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 2fe7fd19437b..4a22909518f5 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c | |||
@@ -411,8 +411,7 @@ static inline void urb_list_move_last(struct urb *urb, int epid) | |||
411 | urb_entry_t *urb_entry = __urb_list_entry(urb, epid); | 411 | urb_entry_t *urb_entry = __urb_list_entry(urb, epid); |
412 | assert(urb_entry); | 412 | assert(urb_entry); |
413 | 413 | ||
414 | list_del(&urb_entry->list); | 414 | list_move_tail(&urb_entry->list, &urb_list[epid]); |
415 | list_add_tail(&urb_entry->list, &urb_list[epid]); | ||
416 | } | 415 | } |
417 | 416 | ||
418 | /* Get the next urb in the list. */ | 417 | /* Get the next urb in the list. */ |
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 5b06fa366098..56ffc81302fc 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -686,19 +686,16 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp) | |||
686 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); | 686 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); |
687 | urb = wrap->urb; | 687 | urb = wrap->urb; |
688 | usb_kill_urb(urb); | 688 | usb_kill_urb(urb); |
689 | list_del(tmp); | 689 | list_move(tmp, &info->rx_urbs_free); |
690 | list_add(tmp, &info->rx_urbs_free); | ||
691 | } | ||
692 | list_for_each_safe(tmp, tmp2, &info->rx_urb_q) { | ||
693 | list_del(tmp); | ||
694 | list_add(tmp, &info->rx_urbs_free); | ||
695 | } | 690 | } |
691 | list_for_each_safe(tmp, tmp2, &info->rx_urb_q) | ||
692 | list_move(tmp, &info->rx_urbs_free); | ||
693 | |||
696 | list_for_each_safe(tmp, tmp2, &info->tx_urbs_submitted) { | 694 | list_for_each_safe(tmp, tmp2, &info->tx_urbs_submitted) { |
697 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); | 695 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); |
698 | urb = wrap->urb; | 696 | urb = wrap->urb; |
699 | usb_kill_urb(urb); | 697 | usb_kill_urb(urb); |
700 | list_del(tmp); | 698 | list_move(tmp, &info->tx_urbs_free); |
701 | list_add(tmp, &info->tx_urbs_free); | ||
702 | } | 699 | } |
703 | spin_unlock_irqrestore(&info->lock, flags); | 700 | spin_unlock_irqrestore(&info->lock, flags); |
704 | 701 | ||
@@ -1080,8 +1077,7 @@ static void whiteheat_write_callback(struct urb *urb, struct pt_regs *regs) | |||
1080 | err("%s - Not my urb!", __FUNCTION__); | 1077 | err("%s - Not my urb!", __FUNCTION__); |
1081 | return; | 1078 | return; |
1082 | } | 1079 | } |
1083 | list_del(&wrap->list); | 1080 | list_move(&wrap->list, &info->tx_urbs_free); |
1084 | list_add(&wrap->list, &info->tx_urbs_free); | ||
1085 | spin_unlock(&info->lock); | 1081 | spin_unlock(&info->lock); |
1086 | 1082 | ||
1087 | if (urb->status) { | 1083 | if (urb->status) { |
@@ -1371,8 +1367,7 @@ static int start_port_read(struct usb_serial_port *port) | |||
1371 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); | 1367 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); |
1372 | urb = wrap->urb; | 1368 | urb = wrap->urb; |
1373 | usb_kill_urb(urb); | 1369 | usb_kill_urb(urb); |
1374 | list_del(tmp); | 1370 | list_move(tmp, &info->rx_urbs_free); |
1375 | list_add(tmp, &info->rx_urbs_free); | ||
1376 | } | 1371 | } |
1377 | break; | 1372 | break; |
1378 | } | 1373 | } |