Avoid reporting on the use of an iterator index variable when
the variable is redeclared.
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
This just needs to find any reassignment of the loop iterator, and doesn't
need such a thing on all execution paths, so use exists on the first rule.
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Make use of the new Requires: tag to be able to specify coccinelle binary
version requirements. The cocci file device_node_continue.cocci requires at
least coccinelle 1.0.4.
Signed-off-by: Luis R. Rodriguez <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Acked-by: Nicolas Palix <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Device node iterators perform an of_node_put on each iteration, so putting
an of_node_put before a continue results in a double put.
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
spatch has changed its option scheme.
E.g., --no_show_diff is now --no-show-diff
This patch updates:
- scripts/coccicheck
- Semantic patches under scripts/coccinelle/
Signed-off-by: Nicolas Palix <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator.
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
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 <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
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 <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
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 <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Michal Marek <[email protected]>