Thread (49 messages) 49 messages, 4 authors, 2021-03-16

[igt-dev] [PATCH i-g-t v23 02/37] lib/igt_list: Add igt_list_del_init()

From: Zbigniew Kempczyński <hidden>
Date: 2021-03-15 16:59:24
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Add helper function for delete and reinitialize list element.

Signed-off-by: Zbigniew Kempczyński <redacted>
Cc: Petri Latvala <redacted>
Cc: Chris Wilson <redacted>
Reviewed-by: Chris Wilson <redacted>
---
 lib/igt_list.c | 6 ++++++
 lib/igt_list.h | 1 +
 2 files changed, 7 insertions(+)
diff --git a/lib/igt_list.c b/lib/igt_list.c
index 5e30b19b6..37ae139c4 100644
--- a/lib/igt_list.c
+++ b/lib/igt_list.c
@@ -46,6 +46,12 @@ void igt_list_del(struct igt_list_head *elem)
 	elem->prev = NULL;
 }
 
+void igt_list_del_init(struct igt_list_head *elem)
+{
+	igt_list_del(elem);
+	IGT_INIT_LIST_HEAD(elem);
+}
+
 void igt_list_move(struct igt_list_head *elem, struct igt_list_head *list)
 {
 	igt_list_del(elem);
diff --git a/lib/igt_list.h b/lib/igt_list.h
index dbf5f802c..cc93d7a0d 100644
--- a/lib/igt_list.h
+++ b/lib/igt_list.h
@@ -75,6 +75,7 @@ struct igt_list_head {
 void IGT_INIT_LIST_HEAD(struct igt_list_head *head);
 void igt_list_add(struct igt_list_head *elem, struct igt_list_head *head);
 void igt_list_del(struct igt_list_head *elem);
+void igt_list_del_init(struct igt_list_head *elem);
 void igt_list_move(struct igt_list_head *elem, struct igt_list_head *list);
 void igt_list_move_tail(struct igt_list_head *elem, struct igt_list_head *list);
 int igt_list_length(const struct igt_list_head *head);
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help