safe_list: add safe_list_empty()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2013-04-15 15:53:57 +02:00
parent ee3e7a6f9f
commit dcf93f3322

View file

@ -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_INIT(_name) { LIST_HEAD_INIT(_name.list), NULL }
#define SAFE_LIST(_name) struct safe_list _name = SAFE_LIST_INIT(_name) #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 #endif