diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2021-07-30 10:58:56 +0100 |
---|---|---|
committer | Julia Lawall <Julia.Lawall@inria.fr> | 2021-08-08 22:00:49 +0200 |
commit | e71ec0bc06038cdfa18cbd23f5cea71fe4785d35 (patch) | |
tree | 3062144ec12a5861928345dabad8431690259217 /crypto/async_tx | |
parent | 9eec0792024983276871baeb201609abb07dd35d (diff) |
scripts: coccinelle: allow list_entry_is_head() to use pos
Currently use_after_iter.cocci generates false positives for code of the
following form:
~~~
list_for_each_entry(d, &ddata->irq_list, node) {
if (irq == d->irq)
break;
}
if (list_entry_is_head(d, &ddata->irq_list, node))
return IRQ_NONE;
~~~
[This specific example comes from drivers/power/supply/cpcap-battery.c]
Most list macros use list_entry_is_head() as loop exit condition meaning it
is not unsafe to reuse pos (a.k.a. d) in the code above.
Let's avoid reporting these cases.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Diffstat (limited to 'crypto/async_tx')
0 files changed, 0 insertions, 0 deletions