]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix dout() macro protection of x, mask
authorSage Weil <sage@newdream.net>
Wed, 17 Jun 2009 20:27:51 +0000 (13:27 -0700)
committerSage Weil <sage@newdream.net>
Wed, 17 Jun 2009 20:27:51 +0000 (13:27 -0700)
src/kernel/ceph_debug.h

index 2add05c27f81ec9622acb97fda83581fe3de1751..70a25216bbe500f797b1165513aaff9321799ec8 100644 (file)
@@ -63,8 +63,8 @@ extern int ceph_debug_tools __read_mostly;
 
 #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);                           \
@@ -74,13 +74,13 @@ extern int ceph_debug_tools __read_mostly;
                }                                                       \
        } 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