From: dlg Date: Thu, 8 Jun 2017 03:30:52 +0000 (+0000) Subject: make rb_n2e return a struct rb_entry *, not void * X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2b871223afe8cd7ee32b4cfc1b2c04da2791acd;p=openbsd make rb_n2e return a struct rb_entry *, not void * maybe this will help prevent misassignment in the future. --- diff --git a/sys/kern/subr_tree.c b/sys/kern/subr_tree.c index 058087062a8..6b7c673c193 100644 --- a/sys/kern/subr_tree.c +++ b/sys/kern/subr_tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_tree.c,v 1.8 2017/06/08 03:22:56 dlg Exp $ */ +/* $OpenBSD: subr_tree.c,v 1.9 2017/06/08 03:30:52 dlg Exp $ */ /* * Copyright 2002 Niels Provos @@ -43,12 +43,12 @@ #include -static inline void * +static inline struct rb_entry * rb_n2e(const struct rb_type *t, void *node) { unsigned long addr = (unsigned long)node; - return ((void *)(addr + t->t_offset)); + return ((struct rb_entry *)(addr + t->t_offset)); } static inline void *