summaryrefslogtreecommitdiff
path: root/coccinelle/empty-if.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/empty-if.cocci')
-rw-r--r--coccinelle/empty-if.cocci19
1 files changed, 19 insertions, 0 deletions
diff --git a/coccinelle/empty-if.cocci b/coccinelle/empty-if.cocci
new file mode 100644
index 0000000000..ebd0bfddce
--- /dev/null
+++ b/coccinelle/empty-if.cocci
@@ -0,0 +1,19 @@
+@@
+expression e, f;
+statement s, t;
+@@
+(
+if (e) {
+if (f) s
+}
+|
+if (e) {
+if (f) s
+else t
+}
+|
+- if (e) {
++ if (e)
+s
+- }
+)