Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / scripts / coccicheck / cocci / kc.cocci
1 //
2 // Use kzalloc rather than kcalloc(1,...)
3 //
4 // Confidence:
5 // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2.
6 // URL: http://coccinelle.lip6.fr/
7 // Options:
8
9 virtual org,patch,diff
10
11 @depends on patch && !org && !diff@
12 @@
13
14 - kcalloc(1,
15 + kzalloc(
16 ...)
17
18 @depends on !patch && !org && diff@
19 position p;
20 @@
21
22 *kcalloc@p(1,...)
23
24 @r depends on !patch && org && !diff@
25 position p;
26 @@
27
28 kcalloc@p(1,...)
29
30 @script:python depends on org@
31 p << r.p;
32 @@
33
34 msg="%s:%s" % (p[0].file, p[0].line)
35 cocci.print_main(msg, p)