All of lore.kernel.org
 help / color / mirror / Atom feed
From: mstefani@redhat.com (Michael Stefaniuc)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Change function invocations argument
Date: Mon, 22 Dec 2014 14:33:49 +0100	[thread overview]
Message-ID: <54981DBD.5000300@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1412211459520.2050@localhost6.localdomain6>

On 12/21/2014 03:01 PM, Julia Lawall wrote:
> 
> 
> On Sun, 21 Dec 2014, Eliseo Mart?nez wrote:
> 
>> That?s right. I wanted to remove external parentheses, which
>> wasn?t done if employing only e2/e3. I hadn?t realized using
>> (e2)/(e3) would take care of both cases (with/without
>> parentheses), though.
>> 
>> BTW, is there an easy way to remove **all** unneeded parentheses,
>> project wide?
> 
> Probably not.  You could remove all parentheses, but that might
> risk removing some needed ones.  On the other hand, Coccinelle does
> know something about precedednce, so you could try:
> 
> -( e1 -)
> 
> and see what happens.  Probably it will do more than you expect,
> though.
Though it is easy to validate that the generated patch is truly a
no-op. I use a sha1sum on the generated object files without and with
the patch and compare those. Of course there is the danger that the
code touched was ifdef'ed out so some developer discretion is still
needed.

bye
	michael

      reply	other threads:[~2014-12-22 13:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20 20:21 [Cocci] Change function invocations argument Eliseo Martínez
2014-12-20 20:32 ` Julia Lawall
2014-12-20 20:45   ` Eliseo Martínez
2014-12-20 20:51     ` Julia Lawall
2014-12-21 10:43       ` Eliseo Martínez
2014-12-21 10:57         ` Julia Lawall
2014-12-21 11:14           ` Eliseo Martínez
2014-12-21 11:16             ` Julia Lawall
2014-12-21 11:19               ` Eliseo Martínez
2014-12-21 11:20                 ` Julia Lawall
2014-12-21 11:55             ` SF Markus Elfring
2014-12-21 12:04               ` Julia Lawall
2014-12-21 12:24                 ` Eliseo Martínez
2014-12-21 12:49                   ` SF Markus Elfring
2014-12-21 12:50                     ` Eliseo Martínez
2014-12-21 12:55                       ` SF Markus Elfring
2014-12-21 13:12                         ` Eliseo Martínez
2014-12-21 13:44                           ` [Cocci] Source code clean-up for parentheses? SF Markus Elfring
2014-12-21 13:48                             ` SF Markus Elfring
2014-12-21 14:13                           ` [Cocci] Change function invocations argument Julia Lawall
2014-12-21 14:01                   ` Julia Lawall
2014-12-22 13:33                     ` Michael Stefaniuc [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=54981DBD.5000300@redhat.com \
    --to=mstefani@redhat.com \
    --cc=cocci@systeme.lip6.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.