diff options
| author | Guenter Roeck <[email protected]> | 2021-04-28 10:35:23 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-05-10 11:19:33 +0200 |
| commit | 3580942c864f90d4eedfbcdf08cdd66ca51494d2 (patch) | |
| tree | 894286340e8e1ea315867feeb0f196d455f551cd /tools/perf/scripts/python | |
| parent | 23017c8842d2b067e3d6ff927e10af61cd65f3a0 (diff) | |
staging: rtl8712: Use list iterators and helpers
Use existing list iterators and helper functions.
The following coccinelle script was used to convert the code.
@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@
<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
... when != e
- while ( \( v1 != e \| e != v1 \) )
+ list_for_each (e, v1)
{
...
- v2 = container_of(e, struct v3, v4);
+ v2 = list_entry(e, struct v3, v4);
?- if (!v2) S
...
(
- e = e->next;
|
- e = get_next(e);
)
... when != e
}
...+>
Compile tested only.
Signed-off-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions