From f10c4c4e4d60958681102e02be2ed0eb1782505b Mon Sep 17 00:00:00 2001 From: Rich Ercolani Date: Thu, 15 Feb 2024 15:32:20 -0500 Subject: [PATCH] Refactor VERIFYF to silence (void) complaining Signed-off-by: Rich Ercolani --- include/os/linux/spl/sys/debug.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/os/linux/spl/sys/debug.h b/include/os/linux/spl/sys/debug.h index d06bb20907b4..2d1f6883381e 100644 --- a/include/os/linux/spl/sys/debug.h +++ b/include/os/linux/spl/sys/debug.h @@ -102,10 +102,11 @@ spl_assert(const char *buf, const char *file, const char *func, int line) spl_assert("VERIFY(" #cond ") failed\n", \ __FILE__, __FUNCTION__, __LINE__)) -#define VERIFYF(cond, str, ...) \ - (void) (unlikely(!(cond)) && \ - spl_panic(__FILE__, __FUNCTION__, __LINE__, \ - "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__)) +#define VERIFYF(cond, str, ...) do { \ + if (unlikely(!cond)) \ + spl_panic(__FILE__, __FUNCTION__, __LINE__, \ + "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__));\ + } while (0) #define VERIFY3B(LEFT, OP, RIGHT) do { \ const boolean_t _verify3_left = (boolean_t)(LEFT); \