From dcf93f332270bdaddb5d24fdba6e3eb5b1f7d80a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 15 Apr 2013 15:53:57 +0200 Subject: [PATCH] safe_list: add safe_list_empty() Signed-off-by: Felix Fietkau --- safe_list.h | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.11.0