From: bluhm Date: Fri, 1 Dec 2023 14:37:22 +0000 (+0000) Subject: Cast mtx to void in dummy MUTEX_ASSERT_LOCKED(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dbbcd4cdc26765f533befbbe5501bb7dd14c097d;p=openbsd 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@ --- 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)