Skip to contentSkip to conversation

small include/linux/list.h integration ...

PATCH New Davide Libenzi 1 participant 1 message Jul 23, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 small include/linux/list.h integration ...

Subject says it all.

- Davide

include/linux/list.h Sun Jul 22 16:22:36 2001 renamed from include/linux/list.h Fri Feb 16 16:06:17 2001 +5 -0
diff -Nru linux-2.4.7.vanilla/include/linux/list.h linux-2.4.7/include/linux/list.h
@@ -149,6 +149,11 @@
 #define list_for_each(pos, head) \
        for (pos = (head)->next; pos != (head); pos = pos->next)
 
+#define list_first(head)       (((head)->next != (head)) ? (head)->next: (struct list_head *) 0)
+#define list_last(head)        (((head)->prev != (head)) ? (head)->prev: (struct list_head *) 0)
+#define list_next(pos, head)   (((pos)->next != (head)) ? (pos)->next: (struct list_head *) 0)
+#define list_prev(pos, head)   (((pos)->prev != (head)) ? (pos)->prev: (struct list_head *) 0)
+
 #endif /* __KERNEL__ || _LVM_H_INCLUDE */
 
 #endif