]> git.baikalelectronics.ru Git - kernel.git/commit
Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs
authorHimangi Saraogi <himangi774@gmail.com>
Sun, 29 Jun 2014 07:16:04 +0000 (12:46 +0530)
committerMichal Marek <mmarek@suse.cz>
Wed, 6 Aug 2014 10:10:17 +0000 (12:10 +0200)
commit16ae03e023187deeb45fa9a48f30dd627b2d2d8c
tree82f41c8e314b54af5e994463fdf7d00008457c4e
parent71b487e79ab542c1a9bc5cdb2917d1776b521f85
Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs

This script detects cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE.

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/misc/array_size.cocci [new file with mode: 0644]