Staging: lustre: lov: Use list_for_each_entry instead of list_for_each
authorBhumika Goyal <bhumirks@gmail.com>
Thu, 25 Feb 2016 17:33:47 +0000 (23:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Feb 2016 06:21:20 +0000 (22:21 -0800)
commitb93656182e02c22bb2f447dfd3dc460500d7e1c7
treee3a6bbc40cdb3cd7b6f71c6779672746e0a06841
parent1bf28ba7d64ac0d50d2c04ac6484a5f9dc3d1dfb
Staging: lustre: lov: Use list_for_each_entry instead of list_for_each

Use list_for_each_entry instead of list_for_each and list_entry as it
simplifies the code. Done using coccinelle:

@@
type T,T2;
identifier I1,I2;
expression e1,e2;
iterator name list_for_each_entry;
iterator name list_for_each;
@@

- T *I1;
...
- list_for_each(I1,e1)
+ list_for_each_entry(I2,e1,e2)
{
...when!=T *I1;
- I2=list_entry(I1,T2,e2);
...
}
...when!=I2;

@@
type T,T2,T3;
identifier I1,I2,I3;
expression e1,e2;
@@

- T *I1;
+ T3 *I3;
...
- list_for_each(I1,e1)
+ list_for_each_entry(I3,e1,e2)
{
...when!=T *I1;
- T3 *I3=list_entry(I1,T2,e2);
...
}
...when!=I3;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lov_request.c