They're all just querying things about the list and not mutating
anything.
Reviewed-by: Thomas Helland<thomashelland90@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
-static inline bool list_empty(struct list_head *list);
+static inline bool list_empty(const struct list_head *list);
static inline void list_replace(struct list_head *from, struct list_head *to)
{
static inline void list_replace(struct list_head *from, struct list_head *to)
{
-static inline bool list_empty(struct list_head *list)
+static inline bool list_empty(const struct list_head *list)
{
return list->next == list;
}
{
return list->next == list;
}
return list->next != NULL && list->next != list && list->next->next == list;
}
return list->next != NULL && list->next != list && list->next->next == list;
}
-static inline unsigned list_length(struct list_head *list)
+static inline unsigned list_length(const struct list_head *list)
{
struct list_head *node;
unsigned length = 0;
{
struct list_head *node;
unsigned length = 0;
-static inline void list_validate(struct list_head *list)
+static inline void list_validate(const struct list_head *list)
{
struct list_head *node;
assert(list->next->prev == list && list->prev->next == list);
{
struct list_head *node;
assert(list->next->prev == list && list->prev->next == list);