/* Iterate forward over the elements of the list. */
#define cds_list_for_each_rcu(pos, head) \
- for (pos = rcu_dereference((head)->next); pos != (head); \
- pos = rcu_dereference(pos->next))
-
+ for (pos = rcu_dereference((head)->next); (pos) != (head); \
+ pos = rcu_dereference((pos)->next))
/* Iterate through elements of the list. */
#define cds_list_for_each_entry_rcu(pos, head, member) \
- for (pos = cds_list_entry(rcu_dereference((head)->next), __typeof__(*pos), member); \
- &pos->member != (head); \
- pos = cds_list_entry(rcu_dereference(pos->member.next), __typeof__(*pos), member))
+ for (pos = cds_list_entry(rcu_dereference((head)->next), __typeof__(*(pos)), member); \
+ &(pos)->member != (head); \
+ pos = cds_list_entry(rcu_dereference((pos)->member.next), __typeof__(*(pos)), member))
#endif /* _URCU_RCULIST_H */