From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: David Somayajulu <david.somayajulu@qlogic.com>,
Adrian Bunk <bunk@kernel.org>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [2.6 patch] scsi/qla4xxx/ql4_isr.c: remove dead code
Date: Tue, 19 Feb 2008 20:43:45 -0600 [thread overview]
Message-ID: <1203475425.3103.42.camel@localhost.localdomain> (raw)
In-Reply-To: <20080220023559.GF23759@plap3.qlogic.org>
On Tue, 2008-02-19 at 18:35 -0800, Andrew Vasquez wrote:
> On Tue, 19 Feb 2008, James Bottomley wrote:
>
> > On Tue, 2008-02-19 at 21:29 +0200, Adrian Bunk wrote:
> > > This patch removes dead code spotted by the Coverity checker.
> > >
> > > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> > >
> > > ---
> > >
> > > drivers/scsi/qla4xxx/ql4_isr.c | 18 +-----------------
> > > 1 file changed, 1 insertion(+), 17 deletions(-)
> > >
> > > --- linux-2.6/drivers/scsi/qla4xxx/ql4_isr.c.old 2008-02-19 20:29:16.000000000 +0200
> > > +++ linux-2.6/drivers/scsi/qla4xxx/ql4_isr.c 2008-02-19 20:30:37.000000000 +0200
> > > @@ -91,38 +91,22 @@ static void qla4xxx_status_entry(struct
> > > if (scsi_status == 0) {
> > > cmd->result = DID_OK << 16;
> > > break;
> > > }
> > >
> > > if (sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) {
> > > cmd->result = DID_ERROR << 16;
> > > break;
> > > }
> > >
> > > - if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER) {
> > > + if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER)
> > > scsi_set_resid(cmd, residual);
> > > - if (!scsi_status && ((scsi_bufflen(cmd) - residual) <
> > > - cmd->underflow)) {
> > > -
> > > - cmd->result = DID_ERROR << 16;
> > > -
> > > - DEBUG2(printk("scsi%ld:%d:%d:%d: %s: "
> > > - "Mid-layer Data underrun0, "
> > > - "xferlen = 0x%x, "
> > > - "residual = 0x%x\n", ha->host_no,
> > > - cmd->device->channel,
> > > - cmd->device->id,
> > > - cmd->device->lun, __func__,
> > > - scsi_bufflen(cmd), residual));
> > > - break;
> > > - }
> > > - }
> >
> > This code doesn't look dead to me, it looks to be enforcing
> > cmd->underrun if set ... what makes the coverity checker think it can
> > never be executed?
>
> Hmm, guess it's the earlier 'if (scsi_status == 0)' check a few lines
> up... Dave S., can you take a look at this... Thanks, av
Ah, so the !scsi_status is wrong it was supposed to be scsi_status !=
0 ... and even then it can just be dropped.
James
next prev parent reply other threads:[~2008-02-20 2:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 19:29 [2.6 patch] scsi/qla4xxx/ql4_isr.c: remove dead code Adrian Bunk
2008-02-20 2:13 ` James Bottomley
2008-02-20 2:35 ` Andrew Vasquez
2008-02-20 2:43 ` James Bottomley [this message]
2008-02-20 2:55 ` Andrew Vasquez
2008-02-21 11:43 ` David Somayajulu
2008-02-21 11:51 ` Rolf Eike Beer
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=1203475425.3103.42.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=andrew.vasquez@qlogic.com \
--cc=bunk@kernel.org \
--cc=david.somayajulu@qlogic.com \
--cc=linux-kernel@vger.kernel.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