]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: dout is a no-op without DEBUG or CONFIG_DYNAMIC_DEBUG
authorSage Weil <sage@newdream.net>
Fri, 17 Jul 2009 21:39:50 +0000 (14:39 -0700)
committerSage Weil <sage@newdream.net>
Fri, 17 Jul 2009 21:39:50 +0000 (14:39 -0700)
src/kernel/ceph_debug.h

index e8cbf4692522365452b34b9a8c068956485066db..4557ea73a2e1488d311d159a5584066fdf48dca6 100644 (file)
@@ -5,12 +5,20 @@
  * wrap pr_debug to include a filename:lineno prefix on each line
  */
 
+#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
 extern const char *ceph_file_part(const char *s, int len);
-
-#define dout(fmt, ...)                                                 \
+# define dout(fmt, ...)                                                        \
        pr_debug(" %12.12s:%-4d : " fmt,                                \
                 ceph_file_part(__FILE__, sizeof(__FILE__)),            \
                 __LINE__, ##__VA_ARGS__);
-
+#else
+/*
+ * this is a no-op, but keep the faux printk call just so we see any
+ * compiler warnings.
+ */
+# define dout(fmt, ...)        do {                                            \
+               if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__);   \
+       } while (0)
+#endif
 
 #endif