From ff8b039ecf8d78162d7ef38f3285d044ebc7d4ec Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 8 Apr 2020 08:57:37 +0300 Subject: [PATCH] tools: Add coccinelle script to catch typecasts to same type Signed-off-by: Donatas Abraitis --- tools/coccinelle/same_type_casting.cocci | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tools/coccinelle/same_type_casting.cocci diff --git a/tools/coccinelle/same_type_casting.cocci b/tools/coccinelle/same_type_casting.cocci new file mode 100644 index 000000000000..58fd7569afed --- /dev/null +++ b/tools/coccinelle/same_type_casting.cocci @@ -0,0 +1,7 @@ +@@ +type T; +T *ptr; +@@ + +- (T *)ptr ++ ptr