From bfbc104f8a7e2db646bc375f69de7472b0764f9e Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 31 Oct 2000 17:20:55 +0000 Subject: [PATCH] Use do { ... } while (0) to wrap the body of mtx_assert(). Reported by: rwatson --- sys/sys/mutex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 1ff8d352184..ff17f6e39ef 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -210,7 +210,7 @@ do { \ #ifdef INVARIANTS #define MA_OWNED 1 #define MA_NOTOWNED 2 -#define mtx_assert(m, what) { \ +#define mtx_assert(m, what) do { \ switch ((what)) { \ case MA_OWNED: \ if (!mtx_owned((m))) \ @@ -225,7 +225,7 @@ do { \ default: \ panic("unknown mtx_assert at %s:%d", __FILE__, __LINE__); \ } \ -} +} while(0) #else /* INVARIANTS */ #define mtx_assert(m, what) #endif /* INVARIANTS */