Coccinelle: Script to detect cast after memory allocation
authorHimangi Saraogi <himangi774@gmail.com>
Sat, 14 Jun 2014 15:45:41 +0000 (21:15 +0530)
committerMichal Marek <mmarek@suse.cz>
Wed, 6 Aug 2014 10:10:17 +0000 (12:10 +0200)
commit99fcec30e882ec214b689889b3599cf98f5c9843
treec267bff61b2ea6dccde7685f52d8fed4f4cd1074
parentb5889ab7d4e6ff194ff1ef8ad2eb9266a23e376b
Coccinelle: Script to detect cast after memory allocation

This script detects cases of use of cast for the value returned by
kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
the cast as it is not useful. This Coccinelle script replaces
drop_kmalloc_cast.cocci as it removes the casting in more limited
cases of kmalloc, kzalloc and kcalloc.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/coccinelle/api/alloc/alloc_cast.cocci [new file with mode: 0644]
scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci [deleted file]