diff options
author | Julia Lawall <Julia.Lawall@inria.fr> | 2020-07-26 13:58:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-27 20:09:57 +0300 |
commit | d21a06d5d8268fb2d5e542c9e189db0556fc534c (patch) | |
tree | 1f1a49d22223c3b31e6d2028a8dd1b0a2421b7a2 /net/ipv4 | |
parent | a57066b1a01977a646145f4ce8dfb4538b08368a (diff) | |
download | linux-d21a06d5d8268fb2d5e542c9e189db0556fc534c.tar.xz |
sfc: drop unnecessary list_empty
list_for_each_safe is able to handle an empty list.
The only effect of avoiding the loop is not initializing the
index variable.
Drop list_empty tests in cases where these variables are not
used.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
<smpl>
@@
expression x,e;
iterator name list_for_each_safe;
statement S;
identifier i,j;
@@
-if (!(list_empty(x))) {
list_for_each_safe(i,j,x) S
- }
... when != i
when != j
(
i = e;
|
? j = e;
)
</smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
0 files changed, 0 insertions, 0 deletions