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.

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to