Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/common/include/linux Provide list_for_each_...



details:   https://anonhg.NetBSD.org/src/rev/1faea27e57e7
branches:  trunk
changeset: 1028628:1faea27e57e7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:32:08 2021 +0000

description:
Provide list_for_each_entry_safe_reverse and reorder for consistency


Author: Maya Rashish <maya%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/common/include/linux/list.h |  21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 1b03f1469ef5 -r 1faea27e57e7 sys/external/bsd/common/include/linux/list.h
--- a/sys/external/bsd/common/include/linux/list.h      Sun Dec 19 11:32:01 2021 +0000
+++ b/sys/external/bsd/common/include/linux/list.h      Sun Dec 19 11:32:08 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: list.h,v 1.27 2021/12/19 10:51:09 riastradh Exp $      */
+/*     $NetBSD: list.h,v 1.28 2021/12/19 11:32:08 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -279,12 +279,6 @@
                (VAR) = list_entry(list_next(&(VAR)->FIELD), typeof(*(VAR)), \
                    FIELD))
 
-#define        list_for_each_entry_reverse(VAR, HEAD, FIELD)                   \
-       for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \
-               &(VAR)->FIELD != (HEAD);                                \
-               (VAR) = list_entry(list_prev(&(VAR)->FIELD), typeof(*(VAR)), \
-                   FIELD))
-
 #define        list_for_each_entry_safe(VAR, NEXT, HEAD, FIELD)                \
        for ((VAR) = list_entry(list_first((HEAD)), typeof(*(VAR)), FIELD); \
                (&(VAR)->FIELD != (HEAD)) &&                            \
@@ -292,6 +286,19 @@
                        typeof(*(VAR)), FIELD), 1);                     \
                (VAR) = (NEXT))
 
+#define        list_for_each_entry_safe_reverse(VAR, NEXT, HEAD, FIELD)        \
+       for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \
+               (&(VAR)->FIELD != (HEAD)) &&                            \
+                   ((NEXT) = list_entry(list_prev(&(VAR)->FIELD),      \
+                       typeof(*(VAR)), FIELD), 1);                     \
+               (VAR) = (NEXT))
+
+#define        list_for_each_entry_reverse(VAR, HEAD, FIELD)                   \
+       for ((VAR) = list_entry(list_last((HEAD)), typeof(*(VAR)), FIELD); \
+               &(VAR)->FIELD != (HEAD);                                \
+               (VAR) = list_entry(list_prev(&(VAR)->FIELD), typeof(*(VAR)), \
+                   FIELD))
+
 #define        list_for_each_entry_continue(VAR, HEAD, FIELD)                  \
        for ((VAR) = list_next_entry((VAR), FIELD);                     \
                &(VAR)->FIELD != (HEAD);                                \



Home | Main Index | Thread Index | Old Index