Re: [Cocci] [PATCH] coccinelle: misc: add swap script

2021-02-16 Thread Markus Elfring
> +- tmp = a; > +- a = b; > +- b = tmp; > ++ swap(a, b); How do you think about to use the following SmPL code variant? * Omission of a few leading space characters * Keeping a semicolon unmodified in a line +-tmp = a; +-a = b; +-b = tmp ++swap(a, b) +; Regards, Markus

[Cocci] [PATCH] coccinelle: misc: add swap script

2021-02-16 Thread Denis Efremov
Check for opencoded swap() implementation. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/swap.cocci | 77 ++ 1 file changed, 77 insertions(+) create mode 100644 scripts/coccinelle/misc/swap.cocci diff --git a/scripts/coccinelle/misc/swap.cocci