From 5373dfabd1e3c908e68c70321f509db7fa205e73 Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 8 Jun 2017 03:22:56 +0000 Subject: [PATCH] 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. --- sys/kern/subr_tree.c | 7 +++---- 1 file 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 @@ -41,13 +41,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include 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)); } -- 2.20.1