From 031018d66c60873e357c4839d44d3336959dcfa3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 17 Jul 2009 14:39:50 -0700 Subject: [PATCH] kclient: dout is a no-op without DEBUG or CONFIG_DYNAMIC_DEBUG --- src/kernel/ceph_debug.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/kernel/ceph_debug.h b/src/kernel/ceph_debug.h index e8cbf46925223..4557ea73a2e14 100644 --- a/src/kernel/ceph_debug.h +++ b/src/kernel/ceph_debug.h @@ -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 -- 2.39.5