Re: [PATCH] coccinelle: Add a script to find and remove unnecessary ifs with no body

2013-11-02 Thread Julia Lawall
> I observed several where the patch seemed entirely correct, with no > FIXME/TODO/XXX comments associated with the conditional. > > Nonetheless, I don't mind removing the patch mode if you don't think > it's worthwhile. I'll send a v2. I think it would be better without it. thanks, julia -- To

Re: [PATCH] coccinelle: Add a script to find and remove unnecessary ifs with no body

2013-11-02 Thread Josh Triplett
On Sat, Nov 02, 2013 at 03:51:50PM +0100, Julia Lawall wrote: > On Sat, 2 Nov 2013, Josh Triplett wrote: > > > This script matches code like: > > > > if (foo) {} > > > > and either eliminates it (if foo has no side effects) or replaces it > > with foo (if foo has side effects). > > > > Works perfe

Re: [PATCH] coccinelle: Add a script to find and remove unnecessary ifs with no body

2013-11-02 Thread Julia Lawall
On Sat, 2 Nov 2013, Josh Triplett wrote: > This script matches code like: > > if (foo) {} > > and either eliminates it (if foo has no side effects) or replaces it > with foo (if foo has side effects). > > Works perfectly in report mode; the results of patch mode are > semantically correct but may

[PATCH] coccinelle: Add a script to find and remove unnecessary ifs with no body

2013-11-02 Thread Josh Triplett
This script matches code like: if (foo) {} and either eliminates it (if foo has no side effects) or replaces it with foo (if foo has side effects). Works perfectly in report mode; the results of patch mode are semantically correct but may still benefit from further simplification. Signed-off-by