summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Burmashev <alexander.burmashev@oracle.com>2021-02-16 07:07:14 -0500
committerPeter Jones <pjones@redhat.com>2021-02-17 19:33:57 -0500
commite6a7fc11a4d939870c9b2cee11ceb061a6737a21 (patch)
tree2903166f55cc0f92f9dc151fd068f0972a6f33e8
parent0287b5a864ba6a567e6fef1b99cf001481fd59e2 (diff)
downloadefi-boot-shim-e6a7fc11a4d939870c9b2cee11ceb061a6737a21.tar.gz
efi-boot-shim-e6a7fc11a4d939870c9b2cee11ceb061a6737a21.zip
add list_empty to linked list primitives
Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com>
-rw-r--r--include/list.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/list.h b/include/list.h
index b98a889e..ad87b45b 100644
--- a/include/list.h
+++ b/include/list.h
@@ -32,6 +32,12 @@ typedef struct list_head list_t;
(ptr)->prev = (ptr); \
})
+static inline int
+list_empty(const struct list_head *head)
+{
+ return head->next == head;
+}
+
static inline void
__list_add(struct list_head *new, struct list_head *prev,
struct list_head *next)