#include "list_types.h"
+static inline
+void side_list_head_init(struct side_list_head *head)
+{
+ head->node.next = head->node.prev = &head->node;
+}
+
static inline
void side_list_insert_node_tail(struct side_list_head *head, struct side_list_node *node)
{
node->prev->next = node->next;
}
+static inline
+bool side_list_empty(struct side_list_head *head)
+{
+ return &head->node == head->node.next;
+}
+
+/*
+ * Splice "from" list at the beginning of "to" list.
+ */
+static inline
+void side_list_splice(struct side_list_head *from, struct side_list_head *to)
+{
+ if (side_list_empty(from))
+ return;
+ from->node.next->prev = &to->node;
+ from->node.prev->next = to->node.next;
+ to->node.next->prev = from->node.prev;
+ to->node.next = from->node.next;
+}
+
#define side_list_for_each_entry(_entry, _head, _member) \
for ((_entry) = side_container_of((_head)->node.next, __typeof__(*(_entry)), _member); \
&(_entry)->_member != &(_head)->node; \