From 849948a7cdaaafabff2f4064841503f5df085512 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 19 Nov 2001 00:20:36 +0000 Subject: [PATCH] cast hashing index to (int)(intptr_t) for calculation. mtx_init() with MTX_QUIET and MTX_NOWITNESS to avoid bogus warnings --- sys/kern/kern_mtxpool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mtxpool.c b/sys/kern/kern_mtxpool.c index 32670231ab08..ee1b64b71d24 100644 --- a/sys/kern/kern_mtxpool.c +++ b/sys/kern/kern_mtxpool.c @@ -51,9 +51,9 @@ static __inline struct mtx * _mtx_pool_find(void *ptr) { - uintptr_t p; + int p; - p = (uintptr_t)ptr; + p = (int)(uintptr_t)ptr; return(&mtx_pool_ary[(p ^ (p >> 6)) & MTX_POOL_MASK]); } @@ -63,7 +63,7 @@ mtx_pool_setup(void *dummy __unused) int i; for (i = 0; i < MTX_POOL_SIZE; ++i) - mtx_init(&mtx_pool_ary[i], "pool mutex", MTX_DEF); + mtx_init(&mtx_pool_ary[i], "pool mutex", MTX_DEF | MTX_NOWITNESS | MTX_QUIET); mtx_pool_valid = 1; }