Lines Matching +full:entry +full:- +full:name
1 /* SPDX-License-Identifier: GPL-2.0 */
10 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
13 * container_of - cast a member of a structure out to the containing structure
16 * @member: the name of the member within the struct.
20 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
21 (type *)( (char *)__mptr - offsetof(type,member) );})
29 #define LIST_HEAD_INIT(name) { &(name), &(name) } argument
31 #define LIST_HEAD(name) \ argument
32 struct list_head name = LIST_HEAD_INIT(name)
35 * list_entry - get the struct for this entry
38 * @member: the name of the list_head within the struct.
44 * list_for_each_entry - iterate over list of given type
47 * @member: the name of the list_head within the struct.
50 for (pos = list_entry((head)->next, typeof(*pos), member); \
51 &pos->member != (head); \
52 pos = list_entry(pos->member.next, typeof(*pos), member))
55 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
59 * @member: the name of the list_head within the struct.
62 for (pos = list_entry((head)->next, typeof(*pos), member), \
63 n = list_entry(pos->member.next, typeof(*pos), member); \
64 &pos->member != (head); \
65 pos = n, n = list_entry(n->member.next, typeof(*n), member))
68 * list_empty - tests whether a list is empty
73 return head->next == head; in list_empty()
77 * Insert a new entry between two known consecutive entries.
86 next->prev = _new; in __list_add()
87 _new->next = next; in __list_add()
88 _new->prev = prev; in __list_add()
89 prev->next = _new; in __list_add()
93 * list_add_tail - add a new entry
94 * @new: new entry to be added
97 * Insert a new entry before the specified head.
102 __list_add(_new, head->prev, head); in list_add_tail()
106 * Delete a list entry by making the prev/next entries
114 next->prev = prev; in __list_del()
115 prev->next = next; in __list_del()
121 * list_del - deletes entry from list.
122 * @entry: the element to delete from the list.
123 * Note: list_empty() on entry does not return true after this, the entry is
126 static inline void list_del(struct list_head *entry) in list_del() argument
128 __list_del(entry->prev, entry->next); in list_del()
129 entry->next = (struct list_head*)LIST_POISON1; in list_del()
130 entry->prev = (struct list_head*)LIST_POISON2; in list_del()