[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9941258f-9243-6400-3c93-ea0637da3e0d@users.sourceforge.net>
Date: Mon, 16 Jul 2018 19:28:38 +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 3/8] Coccinelle: atomic_as_refcounter: Optimise a
disjunction in the first SmPL rule
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 16 Jul 2018 17:43:49 +0200
The variables “fname2” till “fname6” do not care for different function
parameters in the disjunction at the end of a rule in a script
for the semantic patch language.
Thus reduce this disjunction by using a regular expression with
an alternation for an optimised constraint.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
scripts/coccinelle/api/atomic_as_refcounter.cocci | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/scripts/coccinelle/api/atomic_as_refcounter.cocci b/scripts/coccinelle/api/atomic_as_refcounter.cocci
index 46d27b2b1dff..4da83ccfa6f6 100644
--- a/scripts/coccinelle/api/atomic_as_refcounter.cocci
+++ b/scripts/coccinelle/api/atomic_as_refcounter.cocci
@@ -13,12 +13,7 @@ virtual report
identifier a, x;
position p1, p2;
identifier fname =~ "free";
-identifier fname2 =~ ".*destroy.*";
-identifier fname3 =~ ".*del.*";
-identifier fname4 =~ ".*queue_work.*";
-identifier fname5 =~ ".*schedule_work.*";
-identifier fname6 =~ ".*call_rcu.*";
-
+identifier fname2 =~ "(?:call_rcu|de(?:l|stroy)|(?:queue|schedule)_work)";
@@
(
@@ -39,14 +34,6 @@ identifier fname6 =~ ".*call_rcu.*";
fname@p2(a, ...);
|
fname2@p2(...);
-|
- fname3@p2(...);
-|
- fname4@p2(...);
-|
- fname5@p2(...);
-|
- fname6@p2(...);
)
--
2.18.0
Powered by blists - more mailing lists