summaryrefslogtreecommitdiff
path: root/coccinelle
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle')
-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
+- }
+)