summaryrefslogtreecommitdiff
path: root/scripts/coccinelle/misc/array_end.cocci
AgeCommit message (Collapse)Author
13 daysscripts/coccinelle: improve efficiency of array_end.cocciJulia Lawall
* Add disable zero_multiple_format to each rule to avoid considering the possibility that an array index is expressed using '\0' * Omit outer parentheses on context and org/report rules that only match ubt don't transform, since matching a subterm gives the same result whether or not the parentheses are present. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
13 daysscripts/coccinelle: Add script for using ARRAY_END()Alejandro Colomar
Recently, we added an ARRAY_END() macro to simplify finding a pointer one past the last element in an array. Such a pointer is often called the 'end', and thus the macro name. Make it easy to find more places where that macro should be used. See also: 436debc9cad8 ("array_size.h: add ARRAY_END()") 8118f197b7b7 ("mm: fix benign off-by-one bugs") a9e5620c9a9e ("kernel: fix off-by-one benign bugs") 61e9210e2392 ("mm: use ARRAY_END() instead of open-coding it") Cc: Kees Cook <kees@kernel.org> Cc: Markus Elfring <Markus.Elfring@web.de> Cc: Julia Lawall <Julia.Lawall@inria.fr> Cc: Nicolas Palix <nicolas.palix@imag.fr> Signed-off-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>