public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] avoid list seatch in fusion ->proc_info
@ 2004-05-31 20:35 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-05-31 20:35 UTC (permalink / raw)
  To: Emoore; +Cc: linux-scsi

in 2.4 there only was a host no argument to ->proc_info so drivers had
to search on their own.  2.5 has a proper struct Scsi_Host so we better
use it.


--- 1.41/drivers/message/fusion/mptscsih.c	2004-05-29 17:10:51 +02:00
+++ edited/drivers/message/fusion/mptscsih.c	2004-05-31 22:16:41 +02:00
@@ -2188,22 +2188,9 @@
 int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
 			int length, int func)
 {
-	MPT_ADAPTER	*ioc;
-	MPT_SCSI_HOST	*hd = NULL;
+	MPT_SCSI_HOST	*hd = (MPT_SCSI_HOST *)host->hostdata;
+	MPT_ADAPTER	*ioc = hd->ioc;
 	int size = 0;
-
-	dprintk(("Called mptscsih_proc_info: hostno=%d, func=%d\n", host->host_no, func));
-	dprintk(("buffer %p, start=%p (%p) offset=%ld length = %d\n",
-			buffer, start, *start, offset, length));
-
-	for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) {
-		if ((ioc->sh) && (ioc->sh == host)) {
-			hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
-			break;
-		}
-	}
-	if ((ioc == NULL) || (ioc->sh == NULL) || (hd == NULL))
-		return 0;
 
 	if (func) {
 		size = mptscsih_user_command(ioc, buffer, length);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-05-31 20:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-31 20:35 [PATCH] avoid list seatch in fusion ->proc_info Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox