Parcourir la source

dl_list: Add DEFINE_DL_LIST

This allows statically defining an empty initialised list.
Johannes Berg il y a 13 ans
Parent
commit
6604da3cf0
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      src/utils/list.h

+ 3 - 0
src/utils/list.h

@@ -95,4 +95,7 @@ static inline unsigned int dl_list_len(struct dl_list *list)
 	     &item->member != (list); \
 	     item = dl_list_entry(item->member.prev, type, member))
 
+#define DEFINE_DL_LIST(name) \
+	struct dl_list name = { &(name), &(name) }
+
 #endif /* LIST_H */