list_for_each_entry_direction macro
list_for_each_entry_direction - iterate forward/backward over list of given type
#define list_for_each_entry_direction(is_fwd, p, h, field) \
for (p = list_entry(is_fwd ? (h)->next : (h)->prev, typeof(*p), field); \
&(p)->field != (h); \
p = list_entry(is_fwd ? (p)->field.next : (p)->field.prev, typeof(*p), field))
Arguments
is_fwd
the iterate direction, true for forward, false for backward.
p
the type * to use as a loop cursor.
h
the head of the list.
field
the name of the list_head within the struct.
Location | Text |
list.h:355 | #define list_for_each_entry_direction(is_fwd, p, h, field) \ |
smp.h:19 | list_for_each_entry_direction(forward, pos, head, lh) |