summaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorLaurent Vivier2016-06-15 18:14:31 +0200
committerMichael Tokarev2016-09-15 14:32:22 +0200
commitac4e29f100355bd2c5d93376ed9ae5b4b7e98bad (patch)
tree30dc758b5a1f43248a020ab53d388b0cbc9398b9 /scripts/coccinelle
parentcurl: Operate on zero-length file (diff)
downloadqemu-ac4e29f100355bd2c5d93376ed9ae5b4b7e98bad.tar.gz
qemu-ac4e29f100355bd2c5d93376ed9ae5b4b7e98bad.tar.xz
qemu-ac4e29f100355bd2c5d93376ed9ae5b4b7e98bad.zip
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/coccinelle')
-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