From: Felix Fietkau Date: Mon, 15 Apr 2013 13:53:57 +0000 (+0200) Subject: safe_list: add safe_list_empty() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dcf93f332270bdaddb5d24fdba6e3eb5b1f7d80a;p=oweals%2Flibubox.git safe_list: add safe_list_empty() Signed-off-by: Felix Fietkau --- diff --git a/safe_list.h b/safe_list.h index 248f97a..3c8b61b 100644 --- a/safe_list.h +++ b/safe_list.h @@ -53,4 +53,9 @@ void safe_list_del(struct safe_list *list); #define SAFE_LIST_INIT(_name) { LIST_HEAD_INIT(_name.list), NULL } #define SAFE_LIST(_name) struct safe_list _name = SAFE_LIST_INIT(_name) +static inline bool safe_list_empty(struct safe_list *head) +{ + return list_empty(&head->list); +} + #endif