public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: linux-scsi@vger.kernel.org
Subject: [scsi hcil 3/9] misc cleanups
Date: Mon, 24 Oct 2005 18:02:05 -0400	[thread overview]
Message-ID: <20051024220205.GC10567@havoc.gtf.org> (raw)
In-Reply-To: <20051024220013.GA10070@havoc.gtf.org>


commit 4e7dd2d43e3b5aa5868de81bd62a4f1dc5ff51c4
Author: Jeff Garzik <jgarzik@pobox.com>
Date:   Mon Oct 24 15:07:05 2005 -0400

    [SCSI] misc cleanups
    
    - eliminate use of 'channel' and 'id' in starget_for_each_device()
    - unexport __scsi_device_lookup_by_target()
    - add some whitespace after '==', on one line

 drivers/scsi/scsi.c        |   12 ++++--------
 include/scsi/scsi_device.h |    2 --
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 1f0ebab..88aea32 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -1108,13 +1108,10 @@ EXPORT_SYMBOL(__scsi_iterate_devices);
 void starget_for_each_device(struct scsi_target *starget, void * data,
 		     void (*fn)(struct scsi_device *, void *))
 {
-	struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
 	struct scsi_device *sdev;
 
-	shost_for_each_device(sdev, shost) {
-		if ((sdev->channel == starget->channel) &&
-		    (sdev->id == starget->id))
-			fn(sdev, data);
+	list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
+		fn(sdev, data);
 	}
 }
 EXPORT_SYMBOL(starget_for_each_device);
@@ -1133,19 +1130,18 @@ EXPORT_SYMBOL(starget_for_each_device);
  * they're need to access the device list in irq context.  Otherwise you
  * really want to use scsi_device_lookup_by_target instead.
  **/
-struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget,
+static struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget,
 						   uint lun)
 {
 	struct scsi_device *sdev;
 
 	list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
-		if (sdev->lun ==lun)
+		if (sdev->lun == lun)
 			return sdev;
 	}
 
 	return NULL;
 }
-EXPORT_SYMBOL(__scsi_device_lookup_by_target);
 
 /**
  * scsi_device_lookup_by_target - find a device given the target
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 7ece056..233b053 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -192,8 +192,6 @@ extern struct scsi_device *__scsi_device
 						uint, uint, uint);
 extern struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *,
 							uint);
-extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *,
-							  uint);
 extern void starget_for_each_device(struct scsi_target *, void *,
 		     void (*fn)(struct scsi_device *, void *));
 

  parent reply	other threads:[~2005-10-24 22:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-24 22:00 [scsi hcil 0/9] marginalize HCIL a bit Jeff Garzik
2005-10-24 22:01 ` [scsi hcil 1/9] kill unused scsi_scan_single_target() Jeff Garzik
2005-10-24 22:01 ` [scsi hcil 2/9] remove cpqfcTS driver, long uncompilable Jeff Garzik
2005-10-24 22:02 ` Jeff Garzik [this message]
2005-10-29  1:34   ` [scsi hcil 3/9] misc cleanups James Bottomley
2005-10-24 22:02 ` [scsi hcil 4/9] s/scsi_scan_target/spi_scan_target/ Jeff Garzik
2005-10-24 22:03 ` [scsi hcil 5/9] split up __spi_scan_target() Jeff Garzik
2005-10-24 22:03 ` [scsi hcil 6/9] introduce sfoo_printk, sfoo_id, sfoo_channel helpers Jeff Garzik
2005-10-24 22:04 ` [scsi hcil 7/9] use {sdev,scmd,starget,shost}_printk in generic code Jeff Garzik
2005-10-24 22:04 ` [scsi hcil 8/9] use sfoo_printk() in drivers Jeff Garzik
2005-10-24 22:05 ` [scsi hcil 9/9] use scmd_id(), scmd_channel() throughout code Jeff Garzik
2005-10-24 22:30 ` [scsi hcil 10/9] ibmmca bug fix Jeff Garzik

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=20051024220205.GC10567@havoc.gtf.org \
    --to=jgarzik@pobox.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