struct llist_node *first;
};
-#define llist_entry(ptr, type, member) \
- ((ptr) ? container_of(ptr, type, member) : NULL)
+#define llist_entry(ptr, type, member) container_of(ptr, type, member)
static inline struct llist_node *
llist_del_all(struct llist_head *head)
#define llist_for_each_entry_safe(pos, n, node, member) \
for (pos = llist_entry((node), __typeof(*pos), member); \
- pos != NULL && \
+ ((char *)(pos) + offsetof(typeof(*(pos)), member)) != NULL && \
(n = llist_entry(pos->member.next, __typeof(*pos), member), pos); \
pos = n)
#define llist_for_each_entry(pos, node, member) \
for ((pos) = llist_entry((node), __typeof(*(pos)), member); \
- (pos) != NULL; \
+ ((char *)(pos) + offsetof(typeof(*(pos)), member)) != NULL; \
(pos) = llist_entry((pos)->member.next, __typeof(*(pos)), member))
#endif