Daniel Thompson e71ec0bc06 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>
2021-08-08 22:00:49 +02:00
..
2021-07-10 11:01:38 -07:00
2020-12-08 23:30:04 +09:00
2021-07-10 11:01:38 -07:00
2021-04-26 08:38:10 -07:00
2020-10-22 13:13:57 -07:00
2021-07-10 11:01:38 -07:00
2021-02-26 09:41:05 -08:00
2021-05-02 00:43:35 +09:00
2021-05-08 10:00:11 -07:00
2020-12-08 23:30:04 +09:00
2020-12-08 23:30:04 +09:00
2021-07-09 04:01:14 +09:00
2021-05-02 00:43:35 +09:00
2021-05-03 17:23:06 -06:00