From: Julia Lawall Date: Mon, 21 May 2018 06:58:48 +0000 (+0200) Subject: coccinelle: mini_lock: improve performance X-Git-Tag: v4.18-rc1~126^2~6 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=32d0572a75c81a2c70394f9e110ca080b9a733b1;p=linux.git 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 Signed-off-by: Masahiro Yamada --- diff --git a/scripts/coccinelle/locks/mini_lock.cocci b/scripts/coccinelle/locks/mini_lock.cocci index 47f649b0ea87..19c6ee5b986b 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@