]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - list.h
Merge topic branch t/sf_float into pu
[paraslash.git] / list.h
diff --git a/list.h b/list.h
index ddcb69da1e00c4f9b82fc5b35d190b932a0e0709..82f5b36dbd5468a35e3b752b41bc017d65bf9a28 100644 (file)
--- a/list.h
+++ b/list.h
@@ -25,9 +25,11 @@ struct list_head {
 #define INITIALIZED_LIST_HEAD(name) struct list_head name = {&(name), &(name)}
 
 /** This must be called before using any other list functions. */
-#define INIT_LIST_HEAD(ptr) do { \
-       (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
+static inline void init_list_head(struct list_head *head)
+{
+       head->next = head;
+       head->prev = head;
+}
 
 /**
  * Insert a new entry after the specified head.
@@ -159,3 +161,5 @@ static inline int list_is_singular(const struct list_head *head)
  */
 #define list_first_entry(ptr, type, member) \
        list_entry((ptr)->next, type, member)
+#define list_last_entry(ptr, type, member) \
+       list_entry((ptr)->prev, type, member)