[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <15372138-088d-81ce-3d3e-0b95f5d91ce9@users.sourceforge.net>
Date: Mon, 16 Jul 2018 19:34:35 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: kernel-janitors@...r.kernel.org,
Elena Reshetova <elena.reshetova@...el.com>,
Julia Lawall <julia.lawall@...6.fr>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Coccinelle <cocci@...teme.lip6.fr>,
Gilles Muller <Gilles.Muller@...6.fr>,
Michal Marek <michal.lkml@...kovi.net>,
Nicolas Palix <nicolas.palix@...g.fr>
Subject: [PATCH v2 6/8] Coccinelle: atomic_as_refcounter: Use nested
disjunctions in the first SmPL rule
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 16 Jul 2018 18:22:53 +0200
Six function names were specified for a search of function calls
by the means of a disjunction in the rule of a script for
the semantic patch language.
Refactor them into two groups so that the SmPL code repetition
could be reduced a bit.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
.../coccinelle/api/atomic_as_refcounter.cocci | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 4484bea6c9d8..7eae23dc9ea8 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -18,17 +18,15 @@ identifier fname2 =~ "(?:call_rcu|de(?:l|stroy)|(?:queue|schedule)_work)";
@@
(
- atomic_dec_and_test@p1(&(a)->x)
+(atomic_dec_and_test@p1
+|atomic_long_dec_and_test@p1
+|atomic64_dec_and_test@p1
+|local_dec_and_test@p1
+) (&(a)->x)
|
- atomic_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_lock@p1(&(a)->x, ...)
-|
- atomic_long_dec_and_test@p1(&(a)->x)
-|
- atomic64_dec_and_test@p1(&(a)->x)
-|
- local_dec_and_test@p1(&(a)->x)
+(atomic_dec_and_lock@p1
+|atomic_long_dec_and_lock@p1
+) (&(a)->x, ...)
)
...
(
--
2.18.0
Powered by blists - more mailing lists