Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/linux linux: Fix rb tree itera...



details:   https://anonhg.NetBSD.org/src/rev/ce081a2374a4
branches:  trunk
changeset: 1028776:ce081a2374a4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:00:08 2021 +0000

description:
linux: Fix rb tree iteration.

diffstat:

 sys/external/bsd/drm2/include/linux/rbtree.h |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r e5cbbf691364 -r ce081a2374a4 sys/external/bsd/drm2/include/linux/rbtree.h
--- a/sys/external/bsd/drm2/include/linux/rbtree.h      Sun Dec 19 12:00:00 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/rbtree.h      Sun Dec 19 12:00:08 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rbtree.h,v 1.14 2021/12/19 11:45:41 riastradh Exp $    */
+/*     $NetBSD: rbtree.h,v 1.15 2021/12/19 12:00:08 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -87,7 +87,10 @@
        char *vnode = (char *)__UNCONST(rbnode);
 
        vnode -= root->rbr_tree.rbt_ops->rbto_node_offset;
-       return RB_TREE_NEXT(__UNCONST(&root->rbr_tree), vnode);
+       vnode = RB_TREE_NEXT(__UNCONST(&root->rbr_tree), vnode);
+       if (vnode)
+               vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
+       return (struct rb_node *)vnode;
 }
 
 static inline struct rb_node *



Home | Main Index | Thread Index | Old Index