From: Robert Love <robert.w.love@intel.com>
To: James.Bottomley@suse.de, linux-scsi@vger.kernel.org
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Subject: [PATCH 04/11] scsi: use list_move() instead of list_del()/list_add() combination
Date: Fri, 01 Apr 2011 16:06:09 -0700 [thread overview]
Message-ID: <20110401230609.15001.77090.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110401230548.15001.2009.stgit@localhost6.localdomain6>
From: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/esp_scsi.c | 6 ++----
drivers/scsi/fcoe/fcoe_ctlr.c | 6 ++----
drivers/scsi/scsi_tgt_lib.c | 6 ++----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 5755852..9a1af1d 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -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
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index c93f007..fb3a506 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -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
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index f672820..edb8bff 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -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);
next prev parent reply other threads:[~2011-04-01 23:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 23:05 [PATCH 00/11] libfc, libfcoe and fcoe updates for scsi-misc Robert Love
2011-04-01 23:05 ` [PATCH 01/11] libfcoe: Remove mutex_trylock/restart_syscall checks Robert Love
2011-04-01 23:05 ` [PATCH 02/11] fcoe: " Robert Love
2011-04-01 23:06 ` [PATCH 03/11] fcoe: remove unnecessary module state check Robert Love
2011-04-01 23:06 ` Robert Love [this message]
2011-04-01 23:06 ` [PATCH 05/11] libfc: Move host_lock usage into ramp_up/down routines Robert Love
2011-04-01 23:06 ` [PATCH 06/11] libfcoe: clean up netdev mapping properly when the transport goes away Robert Love
2011-04-01 23:06 ` [PATCH 07/11] libfcoe: fix possible buffer overflow in fcoe_transport_show Robert Love
2011-04-01 23:06 ` [PATCH 08/11] libfcoe: fix wrong comment in fcoe_transport_detach Robert Love
2011-04-01 23:06 ` [PATCH 09/11] libfc: remove duplicate ema_list init Robert Love
2011-04-01 23:06 ` [PATCH 10/11] libfc: rec tov value and REC_TOV_CONST units usages is incorrect Robert Love
2011-04-01 23:06 ` [PATCH 11/11] fcoe: have fcoe log off and lport destroy before ndo_fcoe_disable Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110401230609.15001.77090.stgit@localhost6.localdomain6 \
--to=robert.w.love@intel.com \
--cc=James.Bottomley@suse.de \
--cc=kirill@shutemov.name \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).