summaryrefslogtreecommitdiffstats
path: root/tools/coccinelle/argv_find.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'tools/coccinelle/argv_find.cocci')
-rw-r--r--tools/coccinelle/argv_find.cocci23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/coccinelle/argv_find.cocci b/tools/coccinelle/argv_find.cocci
new file mode 100644
index 0000000..1ab19b7
--- /dev/null
+++ b/tools/coccinelle/argv_find.cocci
@@ -0,0 +1,23 @@
+@@
+identifier idx;
+identifier argv;
+identifier argc;
+expression e1;
+expression e2;
+identifier I;
+@@
+
+(
+- argv_find(argv, argc, e1, &idx);
+ if (
+- idx
++ argv_find(argv, argc, e1, &idx)
+ )
+ {
+ e2;
+ }
+|
+- argv_find(argv, argc, e1, &idx);
+... when != I = idx;
+ when strict
+)