summaryrefslogtreecommitdiff
path: root/coccinelle
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/equals-null.cocci27
1 files changed, 21 insertions, 6 deletions
diff --git a/coccinelle/equals-null.cocci b/coccinelle/equals-null.cocci
index 957d828a83..3fce0f4caa 100644
--- a/coccinelle/equals-null.cocci
+++ b/coccinelle/equals-null.cocci
@@ -2,13 +2,28 @@
expression e;
statement s;
@@
-- if (e == NULL)
-+ if (!e)
-s
+if (
+(
+!e
+|
+- e == NULL
++ !e
+)
+ )
+ {...}
+else s
+
@@
expression e;
statement s;
@@
-- if (e != NULL)
-+ if (e)
-s
+if (
+(
+e
+|
+- e != NULL
++ e
+)
+ )
+ {...}
+else s