aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle/iterators (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-01-15scripts/coccinelle: improve the coverage of some semantic patchesJulia Lawall2-16/+111
This patch ensures that all semantic patches in the scripts/coccinelle directory provide the report option. Report messages that include line numbers now have the line number preceded by "line" for easier subsequent processing. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-31Coccinelle: Add iterators/list_entry_update.cocciNicolas Palix1-0/+62
list_for_each_entry uses its first argument to get from one element of the list to the next, so it is usually not a good idea to reassign it. The first rule finds such a reassignment and the second rule checks that there is a path from the reassignment back to the top of the loop. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-31Coccinelle: Add iterators/itnull.cocciNicolas Palix1-0/+58
Many iterators have the property that the first argument is always bound to a real list element, never NULL. False positives arise for some iterators that do not have this property, or in cases when the loop cursor is reassigned. The latter should only happen when the matched code is on the way to a loop exit (break, goto, or return). Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-31Coccinelle: Add iterators/fen.cocciNicolas Palix1-0/+64
for_each_node iterators only exit normally when the loop cursor is NULL, so there is no point to call of_node_put on the final value. Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Michal Marek <mmarek@suse.cz>