Lines Matching +full:entry +full:- +full:name
1 /* SPDX-License-Identifier: GPL-2.0 */
12 * container_of - cast a member of a structure out to the containing structure
15 * @member: the name of the member within the struct.
20 _Static_assert(__same_type(*(ptr), ((type *)0)->member) || \
23 ((type *)(__mptr - offsetof(type, member))); })
35 * using the generic single-entry routines.
42 #define LIST_HEAD_INIT(name) { &(name), &(name) } argument
44 #define LIST_HEAD(name) \ argument
45 struct list_head name = LIST_HEAD_INIT(name)
48 * INIT_LIST_HEAD - Initialize a list_head structure
56 list->next = list; in INIT_LIST_HEAD()
57 list->prev = list; in INIT_LIST_HEAD()
61 * Insert a new entry between two known consecutive entries.
70 next->prev = new; in __list_add()
71 new->next = next; in __list_add()
72 new->prev = prev; in __list_add()
73 prev->next = new; in __list_add()
77 * list_add - add a new entry
78 * @new: new entry to be added
81 * Insert a new entry after the specified head.
86 __list_add(new, head, head->next); in list_add()
90 * list_add_tail - add a new entry
91 * @new: new entry to be added
94 * Insert a new entry before the specified head.
99 __list_add(new, head->prev, head); in list_add_tail()
103 * Delete a list entry by making the prev/next entries
111 next->prev = prev; in __list_del()
112 prev->next = next; in __list_del()
115 static inline void __list_del_entry(struct list_head *entry) in __list_del_entry() argument
117 __list_del(entry->prev, entry->next); in __list_del_entry()
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(entry); in list_del()
129 entry->next = LIST_POISON1; in list_del()
130 entry->prev = LIST_POISON2; in list_del()
134 * list_is_head - tests whether @list is the list @head
135 * @list: the entry to test
144 * list_empty - tests whether a list is empty
149 return head->next == head; in list_empty()
153 * list_entry - get the struct for this entry
156 * @member: the name of the list_head within the struct.
162 * list_first_entry - get the first element from a list
165 * @member: the name of the list_head within the struct.
170 list_entry((ptr)->next, type, member)
173 * list_next_entry - get the next element in list
175 * @member: the name of the list_head within the struct.
178 list_entry((pos)->member.next, typeof(*(pos)), member)
181 * list_entry_is_head - test if the entry points to the head of the list
184 * @member: the name of the list_head within the struct.
187 (&pos->member == (head))
190 * list_for_each_entry - iterate over list of given type
193 * @member: the name of the list_head within the struct.
201 * list_for_each_entry_safe - iterate over list of given type. Safe against removal of list entry
205 * @member: the name of the list_head within the struct.