Skip to content
Commit 8e55b6fd authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman
Browse files

staging: lustre: lnet: replace list_for_each with list_for_each_entry



Replace use of the combination of list_for_each() and list_entry() with
list_for_each_entry() to simplify the code and remove variables that are
used only in list_for_each().
Issue found and corrected using Coccinelle script:

@r@
expression head, member, e;
type T1, T2, T3;
iterator name list_for_each, list_for_each_entry;
identifier pos, var;
@@

-T1 *pos;
...when!=pos

-list_for_each(pos, head)
+list_for_each_entry(var, head, member)
{
...when!=pos
   when!=T3 *var;
-var = list_entry(pos, T2, member);
...when!=pos
}
...when!=pos

Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c35d380
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment