[SCSI] esp, scsi_tgt_lib, fcoe: use list_move() instead of list_del()/list_add()...
authorKirill A. Shutemov <kirill@shutemov.name>
Fri, 1 Apr 2011 23:06:09 +0000 (16:06 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 1 May 2011 15:20:10 +0000 (10:20 -0500)
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/esp_scsi.c
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/scsi_tgt_lib.c

index 57558523c1b8cd67ba8e83aacf8691eba8205928..9a1af1d6071a12ae209e8e29ff93407a11f48a9d 100644 (file)
@@ -708,8 +708,7 @@ static void esp_maybe_execute_command(struct esp *esp)
        tp = &esp->target[tgt];
        lp = dev->hostdata;
 
-       list_del(&ent->list);
-       list_add(&ent->list, &esp->active_cmds);
+       list_move(&ent->list, &esp->active_cmds);
 
        esp->active_cmd = ent;
 
@@ -1244,8 +1243,7 @@ static int esp_finish_select(struct esp *esp)
                /* Now that the state is unwound properly, put back onto
                 * the issue queue.  This command is no longer active.
                 */
-               list_del(&ent->list);
-               list_add(&ent->list, &esp->queued_cmds);
+               list_move(&ent->list, &esp->queued_cmds);
                esp->active_cmd = NULL;
 
                /* Return value ignored by caller, it directly invokes
index 9d38be2a41f975fcdbd7a572388b6b7c03f4a2d9..229e4af5508a272b4f9a0c43b3a8d3929361f2f0 100644 (file)
@@ -978,10 +978,8 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
         * the FCF that answers multicast solicitations, not the others that
         * are sending periodic multicast advertisements.
         */
-       if (mtu_valid) {
-               list_del(&fcf->list);
-               list_add(&fcf->list, &fip->fcfs);
-       }
+       if (mtu_valid)
+               list_move(&fcf->list, &fip->fcfs);
 
        /*
         * If this is the first validated FCF, note the time and
index 8bca8c25ba69e61454d7bcf9a4d77971d991fc2d..84a1fdf67864cc4e0169b78d57687509c403a907 100644 (file)
@@ -275,10 +275,8 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost)
 
        for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) {
                list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i],
-                                        hash_list) {
-                       list_del(&tcmd->hash_list);
-                       list_add(&tcmd->hash_list, &cmds);
-               }
+                                        hash_list)
+                       list_move(&tcmd->hash_list, &cmds);
        }
 
        spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags);