@@ -127,6 +127,29 @@ static inline void list_del(struct list_head *entry)
entry->prev = LIST_POISON2;
}
+/**
+ * list_move - delete from one list and add as another's head
+ * @list: the entry to move
+ * @head: the head that will precede our entry
+ */
+static inline void list_move(struct list_head *list, struct list_head *head)
+{
+ __list_del_entry(list);
+ list_add(list, head);
+}
+
+/**
+ * list_move_tail - delete from one list and add as another's tail
+ * @list: the entry to move
+ * @head: the head that will follow our entry
+ */
+static inline void list_move_tail(struct list_head *list,
+ struct list_head *head)
+{
+ __list_del_entry(list);
+ list_add_tail(list, head);
+}
+
/**
* list_is_head - tests whether @list is the list @head
* @list: the entry to test
Import list_move() and list_move_tail() from include/linux/list.h. These will be used in the next commit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- scripts/kconfig/list.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)