aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-06-15 18:14:31 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2016-09-15 15:32:22 +0300
commitac4e29f100355bd2c5d93376ed9ae5b4b7e98bad (patch)
tree30dc758b5a1f43248a020ab53d388b0cbc9398b9 /scripts
parenta41c457881b5463b18901a849b4289459ab1d231 (diff)
coccinelle: add a script to remove useless casts
Script from LKML. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/typecast.cocci7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/coccinelle/typecast.cocci b/scripts/coccinelle/typecast.cocci
new file mode 100644
index 0000000000..be2183ee4f
--- /dev/null
+++ b/scripts/coccinelle/typecast.cocci
@@ -0,0 +1,7 @@
+// Remove useless casts
+@@
+type T;
+T v;
+@@
+- (T *)&v
++ &v