Commit 63ce2499947683dcc026373e24a4cb5a9d086e7d

Authored by Kirill A. Shutemov
Committed by James Bottomley
1 parent 38b34aca30

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

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>

Showing 3 changed files with 6 additions and 12 deletions Side-by-side Diff

drivers/scsi/esp_scsi.c
... ... @@ -708,8 +708,7 @@
708 708 tp = &esp->target[tgt];
709 709 lp = dev->hostdata;
710 710  
711   - list_del(&ent->list);
712   - list_add(&ent->list, &esp->active_cmds);
  711 + list_move(&ent->list, &esp->active_cmds);
713 712  
714 713 esp->active_cmd = ent;
715 714  
... ... @@ -1244,8 +1243,7 @@
1244 1243 /* Now that the state is unwound properly, put back onto
1245 1244 * the issue queue. This command is no longer active.
1246 1245 */
1247   - list_del(&ent->list);
1248   - list_add(&ent->list, &esp->queued_cmds);
  1246 + list_move(&ent->list, &esp->queued_cmds);
1249 1247 esp->active_cmd = NULL;
1250 1248  
1251 1249 /* Return value ignored by caller, it directly invokes
drivers/scsi/fcoe/fcoe_ctlr.c
... ... @@ -978,10 +978,8 @@
978 978 * the FCF that answers multicast solicitations, not the others that
979 979 * are sending periodic multicast advertisements.
980 980 */
981   - if (mtu_valid) {
982   - list_del(&fcf->list);
983   - list_add(&fcf->list, &fip->fcfs);
984   - }
  981 + if (mtu_valid)
  982 + list_move(&fcf->list, &fip->fcfs);
985 983  
986 984 /*
987 985 * If this is the first validated FCF, note the time and
drivers/scsi/scsi_tgt_lib.c
... ... @@ -275,10 +275,8 @@
275 275  
276 276 for (i = 0; i < ARRAY_SIZE(qdata->cmd_hash); i++) {
277 277 list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i],
278   - hash_list) {
279   - list_del(&tcmd->hash_list);
280   - list_add(&tcmd->hash_list, &cmds);
281   - }
  278 + hash_list)
  279 + list_move(&tcmd->hash_list, &cmds);
282 280 }
283 281  
284 282 spin_unlock_irqrestore(&qdata->cmd_hash_lock, flags);