]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit71b487e79ab542c1a9bc5cdb2917d1776b521f85
treec267bff61b2ea6dccde7685f52d8fed4f4cd1074
parentb33f6168ec6ff069caf9618a6a4291f8596e74a8
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]