[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611175536.3518179-6-masahiroy@kernel.org>
Date: Wed, 12 Jun 2024 02:55:14 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>
Subject: [PATCH 05/16] kconfig: import list_move() and list_move_tail()
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@...nel.org>
---
scripts/kconfig/list.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
index 882859ddf9f4..7008243f48a8 100644
--- a/scripts/kconfig/list.h
+++ b/scripts/kconfig/list.h
@@ -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
--
2.43.0
Powered by blists - more mailing lists