summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-04-28 09:35:22 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-10 11:19:33 +0200
commit23017c8842d2b067e3d6ff927e10af61cd65f3a0 (patch)
treef007ffb1ee6965cd4651db4edfd74691ff759430 /drivers/staging/rtl8712
parentb1e9109aeff366d7e1934e8b3ef8025684c9f6e8 (diff)
staging: rtl8188eu: Use list iterators and helpers
The rtl8188eu manually re-implements list helper functions and macros in various ways. Replace with existing list helpers. 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 } ...+> @@ 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 (1) + list_for_each (e, v1) { - if ( \( e == v1 \| v1 == e \) ) - break; ... - 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 } ...+> Manually fixed up formatting, and added autoremoved comments back in. Compile tested only. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210428163522.129189-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
0 files changed, 0 insertions, 0 deletions