These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / 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