From: Christoph Hellwig <hch@lst.de>
To: Emoore@lsil.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] avoid list seatch in fusion ->proc_info
Date: Mon, 31 May 2004 22:35:17 +0200 [thread overview]
Message-ID: <20040531203517.GA23944@lst.de> (raw)
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);
reply other threads:[~2004-05-31 20:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040531203517.GA23944@lst.de \
--to=hch@lst.de \
--cc=Emoore@lsil.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