Skip to content
Commit 76f6aefd 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=e;

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

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 dd7b01ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment