1
0
Fork 0
alistair23-linux/drivers/staging/lustre/lnet/lnet
Bhaktipriya Shridhar c997866cd2 staging: lustre: lnet: api-ni: Use list_for_each_entry_safe
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
..
Makefile staging: lustre: LNet drop rule implementation 2016-03-07 16:17:45 -08:00
acceptor.c staging: lustre: use sock.h in only acceptor.c 2016-02-22 18:05:49 -08:00
api-ni.c staging: lustre: lnet: api-ni: Use list_for_each_entry_safe 2016-03-11 22:09:09 -08:00
config.c staging: lustre: lnet: config: Use list_for_each_entry_safe 2016-03-11 22:09:09 -08:00
lib-eq.c staging: lustre: return proper error code for LNet core 2016-03-02 15:23:49 -08:00
lib-md.c staging: lustre: assume a kernel build 2016-02-22 18:05:49 -08:00
lib-me.c staging: lustre: assume a kernel build 2016-02-22 18:05:49 -08:00
lib-move.c staging: lustre: lnet: lib-move: Use list_for_each_entry_safe 2016-03-11 22:09:09 -08:00
lib-msg.c staging: lustre: LNet network latency simulation 2016-03-07 16:17:45 -08:00
lib-ptl.c staging: lustre: issue in the offset in lnet match hash table 2016-03-02 15:23:49 -08:00
lib-socket.c staging: lustre: replace direct LNet HZ access with kernel APIs 2016-03-02 15:23:49 -08:00
lo.c staging: lustre: fix all NULL comparisons in LNet layer 2016-02-14 16:20:32 -08:00
module.c staging: lustre: make module_init/exit naming consistent 2016-03-01 19:19:17 -08:00
net_fault.c staging: lustre: LNet network latency simulation 2016-03-07 16:17:45 -08:00
nidstrings.c staging: lustre: remove annoying message in parse_nidrange 2016-03-02 15:23:49 -08:00
peer.c staging: lustre: lnet: peer: Use list_for_each_entry_safe 2016-03-11 22:09:09 -08:00
router.c staging: lustre: lnet: router: Use list_for_each_entry_safe 2016-03-11 22:09:09 -08:00
router_proc.c staging: lustre: make LNet use lprocfs_call_handler 2016-03-07 16:17:45 -08:00