From: Julia Lawall <julia.lawall@lip6.fr>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Finn Thain <fthain@telegraphics.com.au>,
zhong jiang <zhongjiang@huawei.com>,
Michael Schmitz <schmitzmic@gmail.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
John Garry <john.garry@huawei.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi:NCR5380: remove same check condition in NCR5380_select
Date: Fri, 3 Aug 2018 11:52:45 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1808031146090.3871@hadrien> (raw)
In-Reply-To: <CAHp75Vc8tWKUpKS8yY52CdJ=mU-iqcrUCz32ZSSJixLA1bM0tQ@mail.gmail.com>
On Fri, 3 Aug 2018, Andy Shevchenko wrote:
> On Fri, Aug 3, 2018 at 5:24 AM, Finn Thain <fthain@telegraphics.com.au> wrote:
> > On Thu, 2 Aug 2018, zhong jiang wrote:
> >
> >> The same check condition is redundant, so remove one of them.
> >>
> >
> > If you are trying to find redundant code, your coccinelle script is
> > dangerously flawed.
>
> These days too many coccinelle helpers make people think they are
> doing right "clean ups" when in the practice they bring the
> regressions.
>
> Julia, is possible by coccinelle to distinguish memory accesses versus
> I/O? At least it would increase robustness in some cases.
With make coccicheck, the semantic patch should already emit the warning:
//# A common source of false positives is when the argument performs a side
//# effect.
I can modify the rule so that it doesn't report on code that involves
function calls. It could lose some desirable warnings, where the function
call is just a wrapper for eg extracting some field, but it is probably
safer in practice.
julia
prev parent reply other threads:[~2018-08-03 9:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 3:10 [PATCH] scsi:NCR5380: remove same check condition in NCR5380_select zhong jiang
2018-08-02 3:26 ` Bart Van Assche
2018-08-02 3:45 ` zhong jiang
2018-08-02 7:32 ` Michael Schmitz
2018-08-03 2:56 ` Finn Thain
2018-08-03 4:19 ` Michael Schmitz
2018-08-03 6:04 ` Finn Thain
2018-08-03 2:24 ` Finn Thain
2018-08-03 9:10 ` Andy Shevchenko
2018-08-03 9:52 ` Julia Lawall [this message]
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=alpine.DEB.2.20.1808031146090.3871@hadrien \
--to=julia.lawall@lip6.fr \
--cc=andy.shevchenko@gmail.com \
--cc=fthain@telegraphics.com.au \
--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=schmitzmic@gmail.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