cds_list: make cds_list_empty const
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 12 Jun 2024 19:49:09 +0000 (15:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Jun 2024 20:10:27 +0000 (16:10 -0400)
cds_list_empty doesn't modify its argument. Hence, it can be marked as
`const`.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iba952e41543fd6c2e1d6dc8290a20803fa14ce10

include/urcu/list.h

index 4bc88b3f22c505e0f83355d3919eff80fb3ac868..5f7c915fa5be7cde512270c6492da91503dd607e 100644 (file)
@@ -169,7 +169,7 @@ void cds_list_splice(struct cds_list_head *add, struct cds_list_head *head)
                 pos = (p), p = cds_list_entry((pos)->member.next, __typeof__(*(pos)), member))
 
 static inline
-int cds_list_empty(struct cds_list_head *head)
+int cds_list_empty(const struct cds_list_head *head)
 {
        return head == head->next;
 }
This page took 0.026012 seconds and 4 git commands to generate.