#define dout_flag(x, mask, fmt, args...) do { \
if (((ceph_debug_mask | DOUT_UNMASKABLE) & mask) && \
- ((DOUT_VAR >= 0 && x <= DOUT_VAR) || \
- (DOUT_VAR < 0 && x <= ceph_debug))) { \
+ ((DOUT_VAR >= 0 && (x) <= DOUT_VAR) || \
+ (DOUT_VAR < 0 && (x) <= ceph_debug))) { \
if (ceph_debug_console) \
printk(KERN_ERR FMT_PREFIX fmt, LOG_ARGS, \
args); \
} \
} while (0)
-#define _dout(x, fmt, args...) dout_flag(x, DOUT_MASK, fmt FMT_SUFFIX, args)
+#define _dout(x, fmt, args...) dout_flag((x), DOUT_MASK, fmt FMT_SUFFIX, args)
#define _derr(x, fmt, args...) do { \
printk(KERN_ERR FMT_PREFIX fmt FMT_SUFFIX, LOG_ARGS, args); \
} while (0)
-#define dout(x, args...) _dout(x, args, TRAIL_PARAM)
-#define derr(x, args...) _derr(x, args, TRAIL_PARAM)
+#define dout(x, args...) _dout((x), args, TRAIL_PARAM)
+#define derr(x, args...) _derr((x), args, TRAIL_PARAM)
#endif