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 drm/linux: rb_first/last



details:   https://anonhg.NetBSD.org/src/rev/99febe08b79d
branches:  trunk
changeset: 1028537:99febe08b79d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:16:32 2021 +0000

description:
drm/linux: rb_first/last

diffstat:

 sys/external/bsd/drm2/include/linux/rbtree.h |  28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 4c070a172c42 -r 99febe08b79d sys/external/bsd/drm2/include/linux/rbtree.h
--- a/sys/external/bsd/drm2/include/linux/rbtree.h      Sun Dec 19 11:16:24 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/rbtree.h      Sun Dec 19 11:16:32 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rbtree.h,v 1.9 2021/12/19 11:00:18 riastradh Exp $     */
+/*     $NetBSD: rbtree.h,v 1.10 2021/12/19 11:16:32 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -59,13 +59,29 @@
 }
 
 static inline struct rb_node *
+rb_first(struct rb_root *root)
+{
+       char *vnode = RB_TREE_MIN(&root->rbr_tree);
+
+       if (vnode)
+               vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
+       return (struct rb_node *)vnode;
+}
+
+static inline struct rb_node *
+rb_last(struct rb_root *root)
+{
+       char *vnode = RB_TREE_MAX(&root->rbr_tree);
+
+       if (vnode)
+               vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
+       return (struct rb_node *)vnode;
+}
+
+static inline struct rb_node *
 rb_first_cached(struct rb_root_cached *root)
 {
-       char *vnode = RB_TREE_MIN(&root->rb_root.rbr_tree);
-
-       if (vnode)
-               vnode += root->rb_root.rbr_tree.rbt_ops->rbto_node_offset;
-       return (struct rb_node *)vnode;
+       return rb_first(&root->rb_root);
 }
 
 static inline void



Home | Main Index | Thread Index | Old Index