From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: linux-kernel@vger.kernel.org
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Robert Love <robert.w.love@intel.com>,
linux-scsi@vger.kernel.org, devel@open-fcoe.org
Subject: [PATCH 05/13] scsi: use list_move() instead of list_del()/list_add() combination
Date: Wed, 16 Mar 2011 00:53:17 +0200 [thread overview]
Message-ID: <1300229605-14499-5-git-send-email-kirill@shutemov.name> (raw)
In-Reply-To: <1300229605-14499-1-git-send-email-kirill@shutemov.name>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: Robert Love <robert.w.love@intel.com>
Cc: linux-scsi@vger.kernel.org
Cc: devel@open-fcoe.org
---
drivers/scsi/esp_scsi.c | 6 ++----
drivers/scsi/fcoe/libfcoe.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/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 625c6be..a1f7025 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -1004,10 +1004,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 c399be9..4c444b8 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);
--
1.7.4.1
next prev parent reply other threads:[~2011-03-15 22:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 22:53 [PATCH 01/13] Coccinelle: introduce list_move.cocci Kirill A. Shutemov
2011-03-15 22:53 ` [PATCH 02/13] plat-spear: use list_move() instead of list_del()/list_add() combination Kirill A. Shutemov
2011-03-16 3:49 ` viresh kumar
2011-03-15 22:53 ` [PATCH 03/13] dca: " Kirill A. Shutemov
2011-03-15 22:53 ` [PATCH 04/13] dm: " Kirill A. Shutemov
2011-03-15 22:53 ` Kirill A. Shutemov [this message]
2011-03-15 23:52 ` [PATCH 05/13] scsi: " Robert Love
2011-03-15 23:57 ` [PATCH] " Robert Love
2011-03-16 1:52 ` James Bottomley
2011-03-16 21:00 ` Robert Love
2011-03-15 22:53 ` [PATCH 06/13] omap: " Kirill A. Shutemov
2011-03-16 11:43 ` Tomi Valkeinen
2011-03-22 6:14 ` Paul Mundt
2011-03-15 22:53 ` [PATCH 07/13] vmlfb: " Kirill A. Shutemov
2011-03-15 22:53 ` [PATCH 08/13] JFS: " Kirill A. Shutemov
2011-03-21 18:49 ` Dave Kleikamp
2011-03-15 22:53 ` [PATCH 09/13] audit: " Kirill A. Shutemov
2011-03-15 22:53 ` [PATCH 10/13] clockevent: " Kirill A. Shutemov
2011-03-15 22:53 ` [PATCH 11/13] mm: " Kirill A. Shutemov
2011-03-17 13:54 ` Christoph Lameter
2011-03-15 22:53 ` [PATCH 12/13] alsa: " Kirill A. Shutemov
2011-03-16 6:50 ` Takashi Iwai
2011-03-15 22:53 ` [PATCH 13/13] perf: " Kirill A. Shutemov
2011-03-20 9:20 ` [PATCH 01/13] Coccinelle: introduce list_move.cocci Julia Lawall
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=1300229605-14499-5-git-send-email-kirill@shutemov.name \
--to=kirill@shutemov.name \
--cc=James.Bottomley@suse.de \
--cc=devel@open-fcoe.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=robert.w.love@intel.com \
/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).