From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations.
Date: Fri, 14 Oct 2005 15:43:48 -0700 [thread overview]
Message-ID: <20051014224348.GC28524@plap.qlogic.org> (raw)
In-Reply-To: <20051014102434.GA23600@infradead.org>
On Fri, 14 Oct 2005, Christoph Hellwig wrote:
> On Thu, Oct 13, 2005 at 04:16:04PM -0700, Andrew Vasquez wrote:
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
>
> I don't like this at all. Even the first variant with the indirect
> function call seems better than this.
The indirect function call is still there -- the resultant code hasn't
changed with this patch. This patch simply insures that common
queueing code gets updated in one spot rather than two
(qla2x00_queuecommand() qla24xx_queuecommand()). The *only*
difference between the two was the call to
[qla2x00|qla24xx]_start_scsi(). So, beyond style, are there any other
objections.
> > +#define QLA_QUEUE_COMMAND(isp) \
> > +static int \
> > +isp##_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) \
> > +{ \
> > + scsi_qla_host_t *ha = to_qla_host(cmd->device->host); \
> > + fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; \
> > + srb_t *sp; \
> > + int rval; \
> > + if (!fcport) { \
> > + cmd->result = DID_NO_CONNECT << 16; \
> > + goto fail_command; \
> > + } \
>
> While we're at it, I don't think cmd->device->hostdata could ever be
> NULL.
Yes, with the target_parent checks in scsi_alloc_target():
if (shost->transportt->target_parent) {
spin_lock_irqsave(shost->host_lock, flags);
parent = shost->transportt->target_parent(shost, channel, id);
spin_unlock_irqrestore(shost->host_lock, flags);
if (!parent)
return NULL;
}
you are correct. Yet another reason to collapse both -- change the
code in one place.
--
Andrew Vasquez
next prev parent reply other threads:[~2005-10-14 22:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
2005-10-13 23:15 ` [PATCH 1/12] qla2xxx: Correct issue where fcport is prematurely marked DEAD Andrew Vasquez
2005-10-13 23:15 ` [PATCH 2/12] qla2xxx: Add support to dynamically enable/disable ZIO Andrew Vasquez
2005-10-13 23:16 ` [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations Andrew Vasquez
2005-10-14 10:24 ` Christoph Hellwig
2005-10-14 22:43 ` Andrew Vasquez [this message]
2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
2005-10-14 7:30 ` Arjan van de Ven
2005-10-14 13:37 ` Douglas Gilbert
2005-10-14 13:53 ` Arjan van de Ven
2005-10-14 16:27 ` Andrew Vasquez
2005-10-14 18:47 ` Arjan van de Ven
2005-10-19 17:37 ` Andrew Vasquez
2005-10-19 17:43 ` Christoph Hellwig
2005-10-19 17:50 ` Andrew Vasquez
2005-10-19 18:22 ` Christoph Hellwig
2005-10-19 18:18 ` Arjan van de Ven
2005-10-15 11:56 ` Christoph Hellwig
2005-10-16 0:38 ` Douglas Gilbert
2005-10-16 8:32 ` Arjan van de Ven
2005-10-13 23:16 ` [PATCH 5/12] qla2xxx: Add support for embedded ISP24xx firmware Andrew Vasquez
2005-10-14 9:47 ` Christoph Hellwig
2005-10-14 16:50 ` Andrew Vasquez
2005-10-15 11:58 ` Christoph Hellwig
2005-10-17 21:34 ` Andrew Vasquez
2005-10-19 16:19 ` Christoph Hellwig
2005-10-13 23:16 ` [PATCH 6/12] qla2xxx: Resync with latest released firmware -- 4.00.12 Andrew Vasquez
2005-10-13 23:16 ` [PATCH 7/12] qla2xxx: Add hotplug firmware-load support for all ISP types Andrew Vasquez
2005-10-13 23:16 ` [PATCH 8/12] qla2xxx: Resync with latest released ISP23xx/63xx firmware -- 3.03.18 Andrew Vasquez
2005-10-13 23:17 ` [PATCH 9/12] qla2xxx: Use midlayer's int_to_scsilun() function Andrew Vasquez
2005-10-15 11:58 ` Christoph Hellwig
2005-10-13 23:17 ` [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing Andrew Vasquez
2005-10-13 23:17 ` [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute Andrew Vasquez
2005-10-14 9:48 ` Christoph Hellwig
2005-10-14 22:44 ` Andrew Vasquez
2005-10-27 23:03 ` Andrew Vasquez
2005-10-28 22:53 ` Christoph Hellwig
2005-10-13 23:17 ` [PATCH 12/12] qla2xxx: Update version number to 8.01.02-k Andrew Vasquez
2005-10-19 17:42 ` [PATCH 0/16] qla2xxx: update qla2xxx driver " Andrew Vasquez
2005-10-20 23:47 ` James Bottomley
2005-10-21 21:07 ` Andrew Vasquez
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=20051014224348.GC28524@plap.qlogic.org \
--to=andrew.vasquez@qlogic.com \
--cc=James.Bottomley@SteelEye.com \
--cc=hch@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).