Go to the documentation of this file.
9 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
18 #define container_of(ptr, type, member) ({ \
19 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
20 (type *)( (char *)__mptr - offsetof(type,member) );})
28 #define LIST_HEAD_INIT(name) { &(name), &(name) }
30 #define LIST_HEAD(name) \
31 struct list_head name = LIST_HEAD_INIT(name)
39 #define list_entry(ptr, type, member) \
40 container_of(ptr, type, member)
48 #define list_for_each_entry(pos, head, member) \
49 for (pos = list_entry((head)->next, typeof(*pos), member); \
50 &pos->member != (head); \
51 pos = list_entry(pos->member.next, typeof(*pos), member))