summaryrefslogtreecommitdiff
path: root/sys/kern/subr_tree.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2017-06-08 03:22:57 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2017-06-08 03:22:57 +0000
commite761a66fd772f5aaffe56a662c2dc84e1275b05c (patch)
tree9a9a391ffe63cd8450ea886a8abba70dedf9316c /sys/kern/subr_tree.c
parent934692688a9e5c97e76775e1d57540d731e3dddb (diff)
use unsigned long instead of caddr_t to move between nodes and entries.
this removes the need for sys/param.h. this code can be built with only sys/tree.h, which in turn only needs sys/_null.h.
Diffstat (limited to 'sys/kern/subr_tree.c')
-rw-r--r--sys/kern/subr_tree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/subr_tree.c b/sys/kern/subr_tree.c
index 0f8d9eb5cc2..058087062a8 100644
--- a/sys/kern/subr_tree.c
+++ b/sys/kern/subr_tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_tree.c,v 1.7 2017/06/08 03:12:53 dlg Exp $ */
+/* $OpenBSD: subr_tree.c,v 1.8 2017/06/08 03:22:56 dlg Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -41,13 +41,12 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/tree.h>
static inline void *
rb_n2e(const struct rb_type *t, void *node)
{
- caddr_t addr = (caddr_t)node;
+ unsigned long addr = (unsigned long)node;
return ((void *)(addr + t->t_offset));
}
@@ -55,7 +54,7 @@ rb_n2e(const struct rb_type *t, void *node)
static inline void *
rb_e2n(const struct rb_type *t, struct rb_entry *rbe)
{
- caddr_t addr = (caddr_t)rbe;
+ unsigned long addr = (unsigned long)rbe;
return ((void *)(addr - t->t_offset));
}