Module Name: src
Committed By: riastradh
Date: Sun Dec 19 11:36:32 UTC 2021
Modified Files:
src/sys/external/bsd/common/include/linux: list.h
Log Message:
linux/list.h: Add list_safe_reset_next.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/external/bsd/common/include/linux/list.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/common/include/linux/list.h
diff -u src/sys/external/bsd/common/include/linux/list.h:1.28 src/sys/external/bsd/common/include/linux/list.h:1.29
--- src/sys/external/bsd/common/include/linux/list.h:1.28 Sun Dec 19 11:32:08 2021
+++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 11:36:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: list.h,v 1.28 2021/12/19 11:32:08 riastradh Exp $ */
+/* $NetBSD: list.h,v 1.29 2021/12/19 11:36:32 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -107,7 +107,6 @@ static inline bool
list_is_first(const struct list_head *entry, const struct list_head *head)
{
return head == entry->prev;
-
}
static inline bool
@@ -273,6 +272,9 @@ list_del_init(struct list_head *node)
((VAR) != (HEAD)) && ((NEXT) = list_next((VAR)), 1); \
(VAR) = (NEXT))
+#define list_safe_reset_next(VAR, NEXT, FIELD) \
+ (NEXT) = list_next_entry(VAR, FIELD)
+
#define list_for_each_entry(VAR, HEAD, FIELD) \
for ((VAR) = list_entry(list_first((HEAD)), typeof(*(VAR)), FIELD); \
&(VAR)->FIELD != (HEAD); \