mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 23:03:55 +00:00
Use do { ... } while (0) to wrap the body of mtx_assert().
Reported by: rwatson
This commit is contained in:
parent
7ccbb17bb3
commit
bfbc104f8a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68081
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue