]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/list.h
x86: remove set_kernel_exec()
[linux-2.6-omap-h63xx.git] / include / linux / list.h
index 9202703be2a43d15f371a62090ba68ae9ae525e0..75ce2cb4ff6ebc92a8fcaa557a9bd7b6b9b9b1b6 100644 (file)
@@ -264,8 +264,8 @@ static inline void list_del_init(struct list_head *entry)
  */
 static inline void list_move(struct list_head *list, struct list_head *head)
 {
-        __list_del(list->prev, list->next);
-        list_add(list, head);
+       __list_del(list->prev, list->next);
+       list_add(list, head);
 }
 
 /**
@@ -276,8 +276,8 @@ static inline void list_move(struct list_head *list, struct list_head *head)
 static inline void list_move_tail(struct list_head *list,
                                  struct list_head *head)
 {
-        __list_del(list->prev, list->next);
-        list_add_tail(list, head);
+       __list_del(list->prev, list->next);
+       list_add_tail(list, head);
 }
 
 /**
@@ -477,6 +477,17 @@ static inline void list_splice_init_rcu(struct list_head *list,
        for (pos = (head)->next, n = pos->next; pos != (head); \
                pos = n, n = pos->next)
 
+/**
+ * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:       the &struct list_head to use as a loop cursor.
+ * @n:         another &struct list_head to use as temporary storage
+ * @head:      the head for your list.
+ */
+#define list_for_each_prev_safe(pos, n, head) \
+       for (pos = (head)->prev, n = pos->prev; \
+            prefetch(pos->prev), pos != (head); \
+            pos = n, n = pos->prev)
+
 /**
  * list_for_each_entry -       iterate over list of given type
  * @pos:       the type * to use as a loop cursor.
@@ -524,6 +535,20 @@ static inline void list_splice_init_rcu(struct list_head *list,
             prefetch(pos->member.next), &pos->member != (head);        \
             pos = list_entry(pos->member.next, typeof(*pos), member))
 
+/**
+ * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * @pos:       the type * to use as a loop cursor.
+ * @head:      the head for your list.
+ * @member:    the name of the list_struct within the struct.
+ *
+ * Start to iterate over list of given type backwards, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue_reverse(pos, head, member)                \
+       for (pos = list_entry(pos->member.prev, typeof(*pos), member);  \
+            prefetch(pos->member.prev), &pos->member != (head);        \
+            pos = list_entry(pos->member.prev, typeof(*pos), member))
+
 /**
  * list_for_each_entry_from - iterate over list of given type from the current point
  * @pos:       the type * to use as a loop cursor.