permit multiline comments and strings in macros
[bpt/coccinelle.git] / demos / janitorings / remove_cast_kmalloc.cocci
1 // commit 5cbded585d129d0226cb48ac4202b253c781be26
2 // Author: Robert P. J. Day <rpjday@mindspring.com>
3 // Date: Wed Dec 13 00:35:56 2006 -0800
4 //
5 // [PATCH] getting rid of all casts of k[cmz]alloc() calls
6 //
7 // Run this:
8 //
9 // #! /bin/sh
10 // for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
11 // echo "De-casting $f..."
12 // perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
13 // done
14 //
15 // And then go through and reinstate those cases where code is
16 // casting pointers to non-pointers.
17 //
18 // And then drop a few hunks which conflicted with outstanding work.
19
20
21 @@
22 expression E; type T;
23 @@
24 E =
25 - (T)
26 kmalloc(...)