Commit 63ce2499 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by James Bottomley

[SCSI] esp, scsi_tgt_lib, fcoe: use list_move() instead of list_del()/list_add() combination

Signed-off-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 38b34aca
...@@ -708,8 +708,7 @@ static void esp_maybe_execute_command(struct esp *esp) ...@@ -708,8 +708,7 @@ static void esp_maybe_execute_command(struct esp *esp)
tp = &esp->target[tgt]; tp = &esp->target[tgt];
lp = dev->hostdata; lp = dev->hostdata;
list_del(&ent->list); list_move(&ent->list, &esp->active_cmds);
list_add(&ent->list, &esp->active_cmds);
esp->active_cmd = ent; esp->active_cmd = ent;
...@@ -1244,8 +1243,7 @@ static int esp_finish_select(struct esp *esp) ...@@ -1244,8 +1243,7 @@ static int esp_finish_select(struct esp *esp)
/* Now that the state is unwound properly, put back onto /* Now that the state is unwound properly, put back onto
* the issue queue. This command is no longer active. * the issue queue. This command is no longer active.
*/ */
list_del(&ent->list); list_move(&ent->list, &esp->queued_cmds);
list_add(&ent->list, &esp->queued_cmds);
esp->active_cmd = NULL; esp->active_cmd = NULL;
/* Return value ignored by caller, it directly invokes /* Return value ignored by caller, it directly invokes
......
...@@ -978,10 +978,8 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb) ...@@ -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 * the FCF that answers multicast solicitations, not the others that
* are sending periodic multicast advertisements. * are sending periodic multicast advertisements.
*/ */
if (mtu_valid) { if (mtu_valid)
list_del(&fcf->list); list_move(&fcf->list, &fip->fcfs);
list_add(&fcf->list, &fip->fcfs);
}
/* /*
* If this is the first validated FCF, note the time and * If this is the first validated FCF, note the time and
......
...@@ -275,10 +275,8 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost) ...@@ -275,10 +275,8 @@ void scsi_tgt_free_queue(struct Scsi_Host *shost)
for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) { for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) {
list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i], list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i],
hash_list) { hash_list)
list_del(&tcmd->hash_list); list_move(&tcmd->hash_list, &cmds);
list_add(&tcmd->hash_list, &cmds);
}
} }
spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags); spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment