Module Name: src Committed By: riastradh Date: Sun Dec 19 10:51:09 UTC 2021
Modified Files: src/sys/external/bsd/common/include/linux: list.h Log Message: list_for_each_entry_from_reverse To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 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.26 src/sys/external/bsd/common/include/linux/list.h:1.27 --- src/sys/external/bsd/common/include/linux/list.h:1.26 Sun Dec 19 10:39:35 2021 +++ src/sys/external/bsd/common/include/linux/list.h Sun Dec 19 10:51:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: list.h,v 1.26 2021/12/19 10:39:35 riastradh Exp $ */ +/* $NetBSD: list.h,v 1.27 2021/12/19 10:51:09 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -307,6 +307,11 @@ list_del_init(struct list_head *node) (&(VAR)->FIELD != (HEAD)); \ (VAR) = list_next_entry((VAR), FIELD)) +#define list_for_each_entry_from_reverse(VAR, HEAD, FIELD) \ + for (; \ + (&(VAR)->FIELD != (HEAD)); \ + (VAR) = list_prev_entry((VAR), FIELD)) + #define list_for_each_entry_safe_from(VAR, NEXT, HEAD, FIELD) \ for (; \ (&(VAR)->FIELD != (HEAD)) && \