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