public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ewan D. Milne" <emilne@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 4/5] scsi: Change to use list_for_each_entry_safe
Date: Mon, 26 Aug 2013 11:03:39 -0400	[thread overview]
Message-ID: <1377529420-31775-5-git-send-email-emilne@redhat.com> (raw)
In-Reply-To: <1377529420-31775-1-git-send-email-emilne@redhat.com>

From: "Ewan D. Milne" <emilne@redhat.com>

scsi_device_dev_release_usercontext() should be using
"list_for_each_entry_safe" instead of "list_for_each_safe".

Signed-off-by: Ewan D. Milne <emilne@redhat.com>
---
 drivers/scsi/scsi_sysfs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 7394a77..34f7580 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -335,7 +335,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
 	struct scsi_device *sdev;
 	struct device *parent;
 	struct scsi_target *starget;
-	struct list_head *this, *tmp;
+	struct scsi_event *evt, *next;
 	unsigned long flags;
 
 	sdev = container_of(work, struct scsi_device, ew.work);
@@ -352,10 +352,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
 
 	cancel_work_sync(&sdev->event_work);
 
-	list_for_each_safe(this, tmp, &sdev->event_list) {
-		struct scsi_event *evt;
-
-		evt = list_entry(this, struct scsi_event, node);
+	list_for_each_entry_safe(evt, next, &sdev->event_list, node) {
 		list_del(&evt->node);
 		kfree(evt);
 	}
-- 
1.7.11.7


  parent reply	other threads:[~2013-08-26 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 15:03 [PATCH 0/5] Patches to clean up SCSI code Ewan D. Milne
2013-08-26 15:03 ` [PATCH 1/5] scsi: Fix incorrect function name in comment Ewan D. Milne
2013-08-26 15:03 ` [PATCH 2/5] scsi: Correct size of envp[] Ewan D. Milne
2013-08-26 15:03 ` [PATCH 3/5] scsi: Add missing newline to scsi_sysfs.c Ewan D. Milne
2013-08-26 15:03 ` Ewan D. Milne [this message]
2013-08-26 15:03 ` [PATCH 5/5] scsi: Rename scsi_evt_thread() to scsi_evt_work() Ewan D. Milne

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=1377529420-31775-5-git-send-email-emilne@redhat.com \
    --to=emilne@redhat.com \
    --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