From 17fe9bb6e5e66b004d6f52be00655f7c8ddca5a1 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 4 Mar 2020 15:02:23 +0200 Subject: [PATCH] tools: Add coccinelle script to check if bool functions return bool type Signed-off-by: Donatas Abraitis --- scripts/coccinelle/bool_function.cocci | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/coccinelle/bool_function.cocci diff --git a/scripts/coccinelle/bool_function.cocci b/scripts/coccinelle/bool_function.cocci new file mode 100644 index 0000000000..0328ecfbbe --- /dev/null +++ b/scripts/coccinelle/bool_function.cocci @@ -0,0 +1,21 @@ +@@ +identifier fn; +typedef bool; +symbol false; +symbol true; +@@ + +bool fn ( ... ) +{ +<... +return +( +- 0 ++ false +| +- 1 ++ true +) + ; +...> +}