From: Eric Moore <eric.moore@lsi.com>
To: linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com
Subject: RE: [PATCH] - export scsilun_to_int
Date: Thu, 1 Feb 2007 10:24:43 -0700 [thread overview]
Message-ID: <20070201172442.GA8322@lsil.com> (raw)
On Wednesday, January 31, 2007 6:52 PM, James Bottomley wrote:
>
> what's wrong with
>
> memcmp(lun1->scsi_lun, lun2->scsi_lun, 8)
>
> rather than introducing a wrapper? The compiler can even optimise
> memcmp for a fixed size nicely.
>
> James
>
Changed to using memcmp. This replaces the prevous patch.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
diff -uarpN b/drivers/message/fusion/mptscsih.c a/drivers/message/fusion/mptscsih.c
--- b/drivers/message/fusion/mptscsih.c 2007-01-27 19:09:00.000000000 -0700
+++ a/drivers/message/fusion/mptscsih.c 2007-02-01 10:09:24.000000000 -0700
@@ -1016,7 +1016,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HO
int ii;
int max = hd->ioc->req_depth;
struct scsi_cmnd *sc;
- int lun;
+ struct scsi_lun lun;
dsprintk((KERN_INFO MYNAM ": search_running channel %d id %d lun %d max %d\n",
vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun, max));
@@ -1027,13 +1027,14 @@ mptscsih_search_running_cmds(MPT_SCSI_HO
mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii);
if (mf == NULL)
continue;
- lun = scsilun_to_int((struct scsi_lun *)mf->LUN);
- dsprintk(( "search_running: found (sc=%p, mf = %p) chanel %d id %d, lun %d \n",
- hd->ScsiLookup[ii], mf, mf->Bus, mf->TargetID, lun));
+ int_to_scsilun(vdevice->lun, &lun);
if ((mf->Bus != vdevice->vtarget->channel) ||
(mf->TargetID != vdevice->vtarget->id) ||
- (lun != vdevice->lun))
+ memcmp(lun.scsi_lun, mf->LUN, 8))
continue;
+ dsprintk(( "search_running: found (sc=%p, mf = %p) "
+ "channel %d id %d, lun %d \n", hd->ScsiLookup[ii],
+ mf, mf->Bus, mf->TargetID, vdevice->lun));
/* Cleanup
*/
next reply other threads:[~2007-02-01 17:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 17:24 Eric Moore [this message]
2007-02-01 17:35 ` [PATCH] - export scsilun_to_int Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2007-01-31 22:54 Eric Moore
2007-02-01 1:51 ` James Bottomley
2007-02-01 8:35 ` Jeff Garzik
2007-01-31 19:44 Moore, Eric
2007-01-31 20:48 ` James Bottomley
2007-01-29 16:40 Eric Moore
2007-01-31 17:01 ` James Bottomley
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=20070201172442.GA8322@lsil.com \
--to=eric.moore@lsi.com \
--cc=James.Bottomley@SteelEye.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.