aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAttila Fülöp <attila@fueloep.org>2023-03-15 18:13:25 +0000
committerGitHub <noreply@github.com>2023-03-15 18:13:25 +0000
commit5f3611121dd844f81a27d15ed2db770dea189d11 (patch)
treebdf0a8180607c23f21d5fbd3716f03188862bb56 /lib
parentc31bb934cd30050a23f7ad7a648ad29e6cd0ae5d (diff)
Diffstat (limited to 'lib')
-rw-r--r--lib/libspl/include/sys/cmn_err.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libspl/include/sys/cmn_err.h b/lib/libspl/include/sys/cmn_err.h
index 6c71dcb8ec13..6a29e6cff2e1 100644
--- a/lib/libspl/include/sys/cmn_err.h
+++ b/lib/libspl/include/sys/cmn_err.h
@@ -30,35 +30,35 @@
#include <atomic.h>
#define cmn_err_once(ce, ...) \
-{ \
+do { \
static volatile uint32_t printed = 0; \
if (atomic_cas_32(&printed, 0, 1) == 0) { \
cmn_err(ce, __VA_ARGS__); \
} \
-}
+} while (0)
#define vcmn_err_once(ce, fmt, ap) \
-{ \
+do { \
static volatile uint32_t printed = 0; \
if (atomic_cas_32(&printed, 0, 1) == 0) { \
vcmn_err(ce, fmt, ap); \
} \
-}
+} while (0)
#define zcmn_err_once(zone, ce, ...) \
-{ \
+do { \
static volatile uint32_t printed = 0; \
if (atomic_cas_32(&printed, 0, 1) == 0) { \
zcmn_err(zone, ce, __VA_ARGS__); \
} \
-}
+} while (0)
#define vzcmn_err_once(zone, ce, fmt, ap) \
-{ \
+do { \
static volatile uint32_t printed = 0; \
if (atomic_cas_32(&printed, 0, 1) == 0) { \
vzcmn_err(zone, ce, fmt, ap); \
} \
-}
+} while (0)
#endif