public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Varsha Rao <rvarsha016@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	cocci <cocci@systeme.lip6.fr>
Subject: Re: [PATCH] crypto: cavium: zip: Remove unnecessary parentheses
Date: Fri, 30 Mar 2018 13:17:19 -0700	[thread overview]
Message-ID: <1522441039.2210.50.camel@perches.com> (raw)
In-Reply-To: <CAAFX7JTfWdaGra+kWBJt-GXVVO601K03qWnExFKFD_9vxS-03g@mail.gmail.com>

On Thu, 2018-03-29 at 21:03 +0530, Varsha Rao wrote:
> On Wed, Mar 28, 2018 at 11:41 PM, Joe Perches wrote:
> > 
> > On Wed, 2018-03-28 at 23:27, Varsha Rao wrote:
> > > This patch fixes the clang warning of extraneous parentheses, with the
> > > following coccinelle script.
> > > 
> > > @@
> > > identifier i;
> > > constant c;
> > > @@
> > > (
> > > -((i == c))
> > > +i == c
> > > > 
> > > 
> > > -((i <= c))
> > > +i <= c
> > 
> > Why just the "==" and "<=" cases?
> > Why not "<", ">" and ">=" too?
> > 
> > Why not expression instead of constant?
> 
> Initially I had the other cases too and used expression instead of
> constant. But the results included only "==" and "<=" cases with
> constant. Along with one false positive case.
hmm
Perhaps you should use something like this?
@@
identifier i;
constant c;
@@

-(
\(i == c\|i <= c\|i < c\|i >= c\|i > c\)
-)

  reply	other threads:[~2018-03-30 20:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 17:57 [PATCH] crypto: cavium: zip: Remove unnecessary parentheses Varsha Rao
2018-03-28 18:11 ` Joe Perches
2018-03-29 15:33   ` Varsha Rao
2018-03-30 20:17     ` Joe Perches [this message]
2018-03-31  6:17       ` Julia Lawall
2018-03-31  6:18     ` Julia Lawall
2018-03-31  8:48       ` [Cocci] " Varsha Rao
2018-03-31  8:55         ` Julia Lawall

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=1522441039.2210.50.camel@perches.com \
    --to=joe@perches.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rvarsha016@gmail.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