From dbbcd4cdc26765f533befbbe5501bb7dd14c097d Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 1 Dec 2023 14:37:22 +0000 Subject: [PATCH] Cast mtx to void in dummy MUTEX_ASSERT_LOCKED(). To avoid unsued variable in ramdisk kernel, use the argument of MUTEX_ASSERT_LOCKED() also in non DIAGNOSTIC builds. OK sashan@ mvs@ --- sys/sys/mutex.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 22a375a0b96..8bb039aeb54 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.18 2019/04/23 13:35:12 visa Exp $ */ +/* $OpenBSD: mutex.h,v 1.19 2023/12/01 14:37:22 bluhm Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -84,8 +84,8 @@ void __mtx_init(struct mutex *, int); panic("mutex %p held in %s", (mtx), __func__); \ } while (0) #else -#define MUTEX_ASSERT_LOCKED(mtx) do { } while (0) -#define MUTEX_ASSERT_UNLOCKED(mtx) do { } while (0) +#define MUTEX_ASSERT_LOCKED(mtx) do { (void)(mtx); } while (0) +#define MUTEX_ASSERT_UNLOCKED(mtx) do { (void)(mtx); } while (0) #endif #define MUTEX_LOCK_OBJECT(mtx) (&(mtx)->mtx_lock_obj) -- 2.20.1