From 8dfec4a3d518201acaee3d8940a3f4b45daebcbd Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 21 Dec 2010 21:59:21 +0000 Subject: [PATCH] Close body of the VFS_UNLOCK_GIANT() macro into do { } while (0) loop, so it can be used in code like this: if (cond) VFS_UNLOCK_GIANT(vfslocked); else ; /* Do something else. */ Before the change, compiler couldn't decide on its own if else should be applied to the 'if (cond)' or to the if statement inside VFS_UNLOCK_GIANT() macro. --- sys/sys/mount.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index be605b482f3..231e3d69f0f 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -644,7 +644,11 @@ vfs_statfs_t __vfs_statfs; _locked = 0; \ _locked; \ }) -#define VFS_UNLOCK_GIANT(locked) if ((locked)) mtx_unlock(&Giant); +#define VFS_UNLOCK_GIANT(locked) do \ +{ \ + if ((locked)) \ + mtx_unlock(&Giant); \ +} while (0) #define VFS_ASSERT_GIANT(MP) do \ { \ struct mount *_mp; \