Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@lip6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

authored by

Julia Lawall and committed by
Masahiro Yamada
32d0572a 4c1d9bb0

+4 -2
+4 -2
scripts/coccinelle/locks/mini_lock.cocci
··· 67 67 @@ 68 68 69 69 *lock(E1@p,...); 70 - <+... when != E1 70 + ... when != E1 71 + when any 71 72 if (...) { 72 73 ... when != E1 73 74 * return@r ...; 74 75 } 75 - ...+> 76 + ... when != E1 77 + when any 76 78 *unlock@up(E1,...); 77 79 78 80 @script:python depends on org@