2 /// Casting (void *) value returned by kmalloc is useless
3 /// as mentioned in Documentation/CodingStyle, Chap 14.
6 // Copyright: 2009,2010 Nicolas Palix, DIKU. GPLv2.
7 // URL: http://coccinelle.lip6.fr/
8 // Options: -no_includes -include_headers
10 // Keywords: kmalloc, kzalloc, kcalloc
11 // Version min: < 2.6.12 kmalloc
12 // Version min: < 2.6.12 kcalloc
13 // Version min: 2.6.14 kzalloc
21 //----------------------------------------------------------
23 //----------------------------------------------------------
30 \(kmalloc\|kzalloc\|kcalloc\)(...)
32 //----------------------------------------------------------
34 //----------------------------------------------------------
41 \(kmalloc\|kzalloc\|kcalloc\)(...)
43 //----------------------------------------------------------
44 // For org and report mode
45 //----------------------------------------------------------
47 @r depends on org || report@
52 (T@p *)\(kmalloc\|kzalloc\|kcalloc\)(...)
54 @script:python depends on org@
59 coccilib.org.print_safe_todo(p[0], t)
61 @script:python depends on report@
66 msg="WARNING: casting value returned by k[cmz]alloc to (%s *) is useless." % (t)
67 coccilib.report.print_report(p[0], msg)