diff mbox

[PULL,19/27] coccinelle: add a script to remove useless casts

Message ID cbb46cc5e6f662d3896fcea39a74f37a2bdff091.1473839869.git.mjt@msgid.tls.msk.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Tokarev Sept. 14, 2016, 7:58 a.m. UTC
From: Laurent Vivier <lvivier@redhat.com>

Script from LKML.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/coccinelle/typecast.cocci | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 scripts/coccinelle/typecast.cocci
diff mbox

Patch

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