]> git.ipfire.org Git - people/ms/linux.git/blob - tools/include/linux/list.h
tools include: Add compiler.h to list.h
[people/ms/linux.git] / tools / include / linux / list.h
1 #include <linux/compiler.h>
2 #include <linux/kernel.h>
3 #include <linux/types.h>
4
5 #include "../../../include/linux/list.h"
6
7 #ifndef TOOLS_LIST_H
8 #define TOOLS_LIST_H
9 /**
10 * list_del_range - deletes range of entries from list.
11 * @begin: first element in the range to delete from the list.
12 * @end: last element in the range to delete from the list.
13 * Note: list_empty on the range of entries does not return true after this,
14 * the entries is in an undefined state.
15 */
16 static inline void list_del_range(struct list_head *begin,
17 struct list_head *end)
18 {
19 begin->prev->next = end->next;
20 end->next->prev = begin->prev;
21 }
22
23 /**
24 * list_for_each_from - iterate over a list from one of its nodes
25 * @pos: the &struct list_head to use as a loop cursor, from where to start
26 * @head: the head for your list.
27 */
28 #define list_for_each_from(pos, head) \
29 for (; pos != (head); pos = pos->next)
30 #endif