summaryrefslogtreecommitdiffstats
path: root/include/linux/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 4fbe523ab..99ab9c44e 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -85,6 +85,7 @@ static __inline__ void __list_del(struct list_head * prev,
/**
* list_del - deletes entry from list.
* @entry: the element to delete from the list.
+ * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
*/
static __inline__ void list_del(struct list_head *entry)
{
@@ -92,6 +93,16 @@ static __inline__ void list_del(struct list_head *entry)
}
/**
+ * list_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.n
+ */
+static __inline__ void list_del_init(struct list_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ INIT_LIST_HEAD(entry);
+}
+
+/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/