From mboxrd@z Thu Jan 1 00:00:00 1970 From: me@tobin.cc (Tobin C. Harding) Date: Tue, 14 Mar 2017 18:21:06 +1100 Subject: coccinelle Message-ID: <20170314072106.GA2773@eros> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Attempting to do transform using Coccinelle if (foo != 0) { ... -> if (foo) { ... Coccinelle script attempt does not work @@ expression x; @@ ( - x != 0 + x ) `spatch --parse-cocci script.cocci` appears to pass. A similar script worked correctly @@ expression x; @@ ( - x == 0 + !x ) I have read various papers and tutorials to no avail. I have tried various other versions also with no success. Any pointers most appreciated. thanks, Tobin.