coccinelle: add a script to remove useless casts
authorLaurent Vivier <lvivier@redhat.com>
Wed, 15 Jun 2016 16:14:31 +0000 (18:14 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 15 Sep 2016 12:32:22 +0000 (15:32 +0300)
Script from LKML.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
scripts/coccinelle/typecast.cocci [new file with mode: 0644]

diff --git a/scripts/coccinelle/typecast.cocci b/scripts/coccinelle/typecast.cocci
new file mode 100644 (file)
index 0000000..be2183e
--- /dev/null
@@ -0,0 +1,7 @@
+// Remove useless casts
+@@
+type T;
+T v;
+@@
+-      (T *)&v
++      &v