From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "zhongjiang@huawei.com" <zhongjiang@huawei.com>
Cc: "andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
"aacraid@microsemi.com" <aacraid@microsemi.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"john.garry@huawei.com" <john.garry@huawei.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH 2/2] scsi:qlogicfas408: remove the same check in qlogicfas408_detect
Date: Thu, 2 Aug 2018 03:52:14 +0000 [thread overview]
Message-ID: <2ff30988089f3cbc0d2127dbfaa29955e0449997.camel@wdc.com> (raw)
In-Reply-To: <5B627AB2.8000101@huawei.com>
On Thu, 2018-08-02 at 11:29 +0800, zhong jiang wrote:
> On 2018/8/2 11:21, Bart Van Assche wrote:
> > On Thu, 2018-08-02 at 10:45 +0800, zhong jiang wrote:
> > > we should not use same check in a expression. just remove one
> > > of them.
> > >
> > > Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> > > ---
> > > drivers/scsi/qlogicfas408.c | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
> > > index 8b471a9..1409ac1 100644
> > > --- a/drivers/scsi/qlogicfas408.c
> > > +++ b/drivers/scsi/qlogicfas408.c
> > > @@ -567,8 +567,7 @@ void qlogicfas408_setup(int qbase, int id, int int_type)
> > > int qlogicfas408_detect(int qbase, int int_type)
> > > {
> > > REG1;
> > > - return (((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7) &&
> > > - ((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7));
> > > + return (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7;
> > > }
> >
> > Does inb() have any side effects?
>
> just redundant. is it necessary for this . Maybe I miss something.
If doubletest.cocci came up with this patch, I think that script is
wrong and needs a thorough review.
Bart.
next prev parent reply other threads:[~2018-08-02 3:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 2:44 [PATCH 0/2] remove double test condition zhong jiang
2018-08-02 2:45 ` [PATCH 1/2] scsi:qla1280: remove unnessary same condition check zhong jiang
2018-08-02 3:22 ` Bart Van Assche
2018-08-02 2:45 ` [PATCH 2/2] scsi:qlogicfas408: remove the same check in qlogicfas408_detect zhong jiang
2018-08-02 3:21 ` Bart Van Assche
2018-08-02 3:29 ` zhong jiang
2018-08-02 3:52 ` Bart Van Assche [this message]
2018-08-02 4:00 ` zhong jiang
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=2ff30988089f3cbc0d2127dbfaa29955e0449997.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=aacraid@microsemi.com \
--cc=andy.shevchenko@gmail.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=zhongjiang@huawei.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
all inboxes | Powered by JetHome®