aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/crystalhd
diff options
context:
space:
mode:
authorJorgyano Vieira <jorgyano@gmail.com>2012-02-15 00:20:06 -0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-15 17:21:42 -0800
commit413db8c1c75a276c046ea476fee9364ca8df4d12 (patch)
tree646c16600460dee851edf4b8fadd8670d59c63e0 /drivers/staging/crystalhd
parent2140dc9ce752d9b32c84c63c42d157ef863fe84a (diff)
downloadlinaro-lsk-413db8c1c75a276c046ea476fee9364ca8df4d12.tar.gz
Staging: crystalhd: crystalhd_misc: improved debug macros
Improvement of debug macros to ensure safe use on if/else statements. Signed-off-by: Jorgyano Vieira <jorgyano@gmail.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/crystalhd')
-rw-r--r--drivers/staging/crystalhd/crystalhd_misc.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
index 4d617235742..e0aa361c393 100644
--- a/drivers/staging/crystalhd/crystalhd_misc.h
+++ b/drivers/staging/crystalhd/crystalhd_misc.h
@@ -203,26 +203,30 @@ enum _chd_log_levels {
BCMLOG_ENTER_LEAVE = 0x00000008, /* stack tracking */
};
-#define BCMLOG_ENTER \
-if (g_linklog_level & BCMLOG_ENTER_LEAVE) { \
- printk(KERN_DEBUG "Entered %s\n", __func__); \
-}
-
-#define BCMLOG_LEAVE \
-if (g_linklog_level & BCMLOG_ENTER_LEAVE) { \
- printk(KERN_DEBUG "Leaving %s\n", __func__); \
-}
-
-#define BCMLOG(trace, fmt, args...) \
-if (g_linklog_level & trace) { \
- printk(fmt, ##args); \
-}
-
-#define BCMLOG_ERR(fmt, args...) \
-do { \
- if (g_linklog_level & BCMLOG_ERROR) { \
- printk(KERN_ERR "*ERR*:%s:%d: "fmt, __FILE__, __LINE__, ##args); \
- } \
-} while (0);
+#define BCMLOG_ENTER \
+do { \
+ if (g_linklog_level & BCMLOG_ENTER_LEAVE) \
+ printk(KERN_DEBUG "Entered %s\n", __func__); \
+} while (0)
+
+#define BCMLOG_LEAVE \
+do { \
+ if (g_linklog_level & BCMLOG_ENTER_LEAVE) \
+ printk(KERN_DEBUG "Leaving %s\n", __func__); \
+} while (0) \
+
+#define BCMLOG(trace, fmt, args...) \
+do { \
+ if (g_linklog_level & trace) \
+ printk(fmt, ##args); \
+} while (0)
+
+
+#define BCMLOG_ERR(fmt, args...) \
+do { \
+ if (g_linklog_level & BCMLOG_ERROR) \
+ printk(KERN_ERR "*ERR*:%s:%d: "fmt, \
+ __FILE__, __LINE__, ##args); \
+} while (0)
#endif