Re: [Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-08 Thread Michal Marek
On 2.11.2013 17:49, Julia Lawall wrote: +@r depends on report || context@ +expression E; +position p; +@@ +if@p (E) {} There should be a * in front of the if, to support context mode. Josh, will you send a v3 with the above fix? Thanks, Michal

[Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-02 Thread Josh Triplett
This script finds code like this, with an unnecessary if: if (foo) {} Provides report mode only, since patching often eliminates conditionals that contain TODO comments or similar. Signed-off-by: Josh Triplett j...@joshtriplett.org --- v2: Drop patch mode.