list: add mk_list_append/prepend functions as a result of review.
@@ -111,6 +111,30 @@ static inline void mk_list_add_before(struct mk_list *_new,
next->prev = _new;
}
+static inline void mk_list_append(struct mk_list *_new, struct mk_list *head)
+{
+ if (mk_list_is_empty(head) == 0) {
+ __mk_list_add(_new, head->prev, head);
+ }
+ else {
+ mk_list_add_after(_new,
+ head->prev,
+ head);
+ }
+}
+
+static inline void mk_list_prepend(struct mk_list *_new, struct mk_list *head)
+{
+ if (mk_list_is_empty(head) == 0) {
+ __mk_list_add(_new, head->prev, head);
+ }
+ else {
+ mk_list_add_before(_new,
+ head->next,
+ head);
+ }
+}
+
static inline void __mk_list_del(struct mk_list *prev, struct mk_list *next)
{
prev->next = next;
