aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-05-20 16:00:04 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-05-20 16:00:04 -0700
commit8f6a15f095a63a83b096d9b29aaff4f0fbe6f6e6 (patch)
tree49d0a39491507d7f09cafc1034f0a29a9cb62aff /scripts
parent3eb3c33c1d87029a3832e205eebd59cfb56ba3a4 (diff)
parent88a1fc21df74514bb3a3ae88b89cf1272c7c0c6e (diff)
downloadlinux-master.tar.gz
Merge tag 'cocci-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linuxHEADmaster
Pull coccinelle updates from Julia Lawall: "One patch slightly improves the text in a comment. The other patch (on minmax.cocci) removes a report about ? being used in return statements that has been generating not very useful suggestions to change idiomatic code" * tag 'cocci-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux: Coccinelle: pm_runtime: Fix grammar in comment coccinelle: misc: minmax: Suppress reports for err returns
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/api/pm_runtime.cocci2
-rw-r--r--scripts/coccinelle/misc/minmax.cocci32
2 files changed, 17 insertions, 17 deletions
diff --git a/scripts/coccinelle/api/pm_runtime.cocci b/scripts/coccinelle/api/pm_runtime.cocci
index 4b97788744535..2c931e748ddaa 100644
--- a/scripts/coccinelle/api/pm_runtime.cocci
+++ b/scripts/coccinelle/api/pm_runtime.cocci
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-/// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE
+/// Make sure pm_runtime_* calls do not unnecessarily use IS_ERR_VALUE
///
// Keywords: pm_runtime
// Confidence: Medium
diff --git a/scripts/coccinelle/misc/minmax.cocci b/scripts/coccinelle/misc/minmax.cocci
index fcf908b34f272..ca4830ae30420 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;