From: Petros Koutoupis <petros@petroskoutoupis.com>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: Finn Thain <fthain@telegraphics.com.au>,
kashyap.desai@avagotech.com, sumit.saxena@avagotech.com,
uday.lingala@avagotech.com, megaraidlinux.pdl@avagotech.com,
linux-scsi <linux-scsi@vger.kernel.org>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] megaraid: add scsi_cmnd NULL check before use
Date: Sun, 08 May 2016 21:59:21 -0500 [thread overview]
Message-ID: <1462762761.3006.1.camel@petros-ultrathin> (raw)
In-Reply-To: <CAGRGNgVYdamHZcpz6tPFK8brjNjDjytBrtjZzxb9c8+Kw7H9rg@mail.gmail.com>
On Mon, 2016-05-09 at 11:35 +1000, Julian Calaby wrote:
> Hi Petros,
>
> On Mon, May 9, 2016 at 2:34 AM, Petros Koutoupis
> <petros@petroskoutoupis.com> wrote:
> > On Sun, 2016-05-08 at 22:22 +1000, Finn Thain wrote:
> >> On Sun, 8 May 2016, Petros Koutoupis wrote:
> >>
> >> > >
> >> > > That contains a tautology.
> >> > >
> >> >
> >> > How so?
> >>
> >> if (x)
> >> /* ... */
> >> else if (!x && (whatever))
> >> /* ... */
> >>
> >> --
> >
> > Thank you but I know the logic of what I wrote. A tautology
> > will yield the same results no matter what the interpretation.
> > That is not a tautology. The two conditionals in my case check
> > different states and serve different purposes.
>
> You're missing the point.
>
> Execution will only reach the else branch if "!cmd_fusion->scmd",
> hence checking that is unnecessary. Removing that test (and all the
> unnecessary parentheses) will reduce the second test to:
>
> else if (scsi_io_req->Function == MPI2_FUNCTION_SCSI_IO_REQUEST ||
> scsi_io_req->Function == MEGASAS_MPI2_FUNCTION_LD_IO_REQUEST)
>
> which is much cleaner.
>
> Thanks,
>
Julian,
I agree. I will clean up and resend. Thank you.
next prev parent reply other threads:[~2016-05-09 2:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 0:40 [PATCH] megaraid: add scsi_cmnd NULL check before use Petros Koutoupis
2016-05-08 3:32 ` Finn Thain
2016-05-08 12:08 ` Petros Koutoupis
2016-05-08 12:22 ` Finn Thain
2016-05-08 16:34 ` Petros Koutoupis
2016-05-09 1:35 ` Julian Calaby
2016-05-09 2:59 ` Petros Koutoupis [this message]
2016-05-09 8:05 ` Dan Carpenter
2016-05-09 9:43 ` Dan Carpenter
2016-05-09 9:48 ` Sumit Saxena
2016-05-09 19:29 ` Dan Carpenter
2016-05-09 21:28 ` Petros Koutoupis
2016-05-11 9:41 ` Sumit Saxena
2016-05-12 1:49 ` Petros Koutoupis
2016-05-12 6:35 ` Dan Carpenter
2016-05-12 12:35 ` Sumit Saxena
2016-05-13 7:43 ` Finn Thain
2016-05-13 7:43 ` Sumit Saxena
2016-05-13 9:25 ` Finn Thain
2016-05-13 23:34 ` Petros Koutoupis
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=1462762761.3006.1.camel@petros-ultrathin \
--to=petros@petroskoutoupis.com \
--cc=dan.carpenter@oracle.com \
--cc=fthain@telegraphics.com.au \
--cc=julian.calaby@gmail.com \
--cc=kashyap.desai@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux.pdl@avagotech.com \
--cc=sumit.saxena@avagotech.com \
--cc=uday.lingala@avagotech.com \
/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).