2015-11-11 22:54:42 +07:00
|
|
|
#include <linux/compiler.h>
|
2011-01-12 05:56:53 +07:00
|
|
|
#include <linux/kernel.h>
|
2014-04-26 02:31:02 +07:00
|
|
|
#include <linux/types.h>
|
2011-05-22 15:07:37 +07:00
|
|
|
|
2015-06-01 14:37:48 +07:00
|
|
|
#include "../../../include/linux/list.h"
|
2009-07-02 00:46:08 +07:00
|
|
|
|
2015-06-01 14:37:48 +07:00
|
|
|
#ifndef TOOLS_LIST_H
|
|
|
|
#define TOOLS_LIST_H
|
2009-07-02 00:46:08 +07:00
|
|
|
/**
|
|
|
|
* list_del_range - deletes range of entries from list.
|
|
|
|
* @begin: first element in the range to delete from the list.
|
|
|
|
* @end: last element in the range to delete from the list.
|
|
|
|
* Note: list_empty on the range of entries does not return true after this,
|
|
|
|
* the entries is in an undefined state.
|
|
|
|
*/
|
|
|
|
static inline void list_del_range(struct list_head *begin,
|
|
|
|
struct list_head *end)
|
|
|
|
{
|
|
|
|
begin->prev->next = end->next;
|
|
|
|
end->next->prev = begin->prev;
|
|
|
|
}
|
2010-08-07 02:51:12 +07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* list_for_each_from - iterate over a list from one of its nodes
|
|
|
|
* @pos: the &struct list_head to use as a loop cursor, from where to start
|
|
|
|
* @head: the head for your list.
|
|
|
|
*/
|
|
|
|
#define list_for_each_from(pos, head) \
|
2011-05-21 02:50:29 +07:00
|
|
|
for (; pos != (head); pos = pos->next)
|
2009-07-02 00:46:08 +07:00
|
|
|
#endif
|