summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/misc/minmax.cocci32
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/coccinelle/misc/minmax.cocci b/scripts/coccinelle/misc/minmax.cocci
index fcf908b34f27..ca4830ae3042 100644
--- a/scripts/coccinelle/misc/minmax.cocci
+++ b/scripts/coccinelle/misc/minmax.cocci
@@ -50,11 +50,26 @@ func(...)
...>
}
+// Ignore errcode returns.
+@errcode@
+position p;
+identifier func;
+expression x;
+binary operator cmp = {<, <=};
+@@
+
+func(...)
+{
+ <...
+ return ((x) cmp@p 0 ? (x) : 0);
+ ...>
+}
+
@rmin depends on !patch@
identifier func;
expression x, y;
binary operator cmp = {<, <=};
-position p;
+position p != errcode.p;
@@
func(...)
@@ -116,21 +131,6 @@ func(...)
...>
}
-// Don't generate patches for errcode returns.
-@errcode depends on patch@
-position p;
-identifier func;
-expression x;
-binary operator cmp = {<, <=};
-@@
-
-func(...)
-{
- <...
- return ((x) cmp@p 0 ? (x) : 0);
- ...>
-}
-
@pmin depends on patch@
identifier func;
expression x, y;