[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1526885928-1712-1-git-send-email-Julia.Lawall@lip6.fr>
Date: Mon, 21 May 2018 08:58:48 +0200
From: Julia Lawall <Julia.Lawall@...6.fr>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: kernel-janitors@...r.kernel.org,
Gilles Muller <Gilles.Muller@...6.fr>,
Nicolas Palix <nicolas.palix@...g.fr>,
Michal Marek <michal.lkml@...kovi.net>, cocci@...teme.lip6.fr,
linux-kernel@...r.kernel.org
Subject: [PATCH] coccinelle: mini_lock: improve performance
Replace <+... ...+> by ... when any. <+... ...+> is slow, and in some
obscure cases involving backward jumps it doesn't force the unlock to
actually come after the end of the if.
Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
---
scripts/coccinelle/locks/mini_lock.cocci | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/coccinelle/locks/mini_lock.cocci b/scripts/coccinelle/locks/mini_lock.cocci
index 47f649b..19c6ee5 100644
--- a/scripts/coccinelle/locks/mini_lock.cocci
+++ b/scripts/coccinelle/locks/mini_lock.cocci
@@ -67,12 +67,14 @@ identifier lock,unlock;
@@
*lock(E1@p,...);
-<+... when != E1
+... when != E1
+ when any
if (...) {
... when != E1
* return@r ...;
}
-...+>
+... when != E1
+ when any
*unlock@up(E1,...);
@script:python depends on org@
Powered by blists - more mailing lists