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: Fix an even number ...



details:   https://anonhg.NetBSD.org/src/rev/f107733fccd2
branches:  trunk
changeset: 1028945:f107733fccd2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:33:11 2021 +0000

description:
drm: Fix an even number of sign errors in interval_tree_generic.h.

diffstat:

 sys/external/bsd/drm2/include/linux/interval_tree_generic.h |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r e6b0965de9ab -r f107733fccd2 sys/external/bsd/drm2/include/linux/interval_tree_generic.h
--- a/sys/external/bsd/drm2/include/linux/interval_tree_generic.h       Sun Dec 19 12:33:02 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/interval_tree_generic.h       Sun Dec 19 12:33:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interval_tree_generic.h,v 1.4 2021/12/19 12:22:28 riastradh Exp $      */
+/*     $NetBSD: interval_tree_generic.h,v 1.5 2021/12/19 12:33:11 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,6 +32,10 @@
 #ifndef        _LINUX_INTERVAL_TREE_GENERIC_H_
 #define        _LINUX_INTERVAL_TREE_GENERIC_H_
 
+/* XXX See interval_tree.h for warnings. */
+
+#include <sys/rbtree.h>
+
 #define        INTERVAL_TREE_DEFINE(T, F, KT, KLAST, NSTART, NLAST, QUAL, PREFIX)    \
                                                                              \
 static inline int                                                            \
@@ -49,7 +53,7 @@
        if (__alast < __blast)                                                \
                return -1;                                                    \
        if (__alast > __blast)                                                \
-               return -1;                                                    \
+               return +1;                                                    \
        return 0;                                                             \
 }                                                                            \
                                                                              \
@@ -103,7 +107,7 @@
        __node = rb_tree_find_node_geq(&__root->rb_root.rbr_tree, &__start);  \
        if (__node == NULL)                                                   \
                return NULL;                                                  \
-       KASSERT(START(__node) <= __start);                                    \
+       KASSERT(__start <= START(__node));                                    \
        if (__last < START(__node))                                           \
                return NULL;                                                  \
                                                                              \



Home | Main Index | Thread Index | Old Index