Commit 413db8c1 authored by Jorgyano Vieira's avatar Jorgyano Vieira Committed by Greg Kroah-Hartman

Staging: crystalhd: crystalhd_misc: improved debug macros

Improvement of debug macros to ensure safe use on if/else statements.
Signed-off-by: default avatarJorgyano Vieira <jorgyano@gmail.com>
Acked-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2140dc9c
...@@ -204,25 +204,29 @@ enum _chd_log_levels { ...@@ -204,25 +204,29 @@ enum _chd_log_levels {
}; };
#define BCMLOG_ENTER \ #define BCMLOG_ENTER \
if (g_linklog_level & BCMLOG_ENTER_LEAVE) { \ do { \
if (g_linklog_level & BCMLOG_ENTER_LEAVE) \
printk(KERN_DEBUG "Entered %s\n", __func__); \ printk(KERN_DEBUG "Entered %s\n", __func__); \
} } while (0)
#define BCMLOG_LEAVE \ #define BCMLOG_LEAVE \
if (g_linklog_level & BCMLOG_ENTER_LEAVE) { \ do { \
if (g_linklog_level & BCMLOG_ENTER_LEAVE) \
printk(KERN_DEBUG "Leaving %s\n", __func__); \ printk(KERN_DEBUG "Leaving %s\n", __func__); \
} } while (0) \
#define BCMLOG(trace, fmt, args...) \ #define BCMLOG(trace, fmt, args...) \
if (g_linklog_level & trace) { \ do { \
if (g_linklog_level & trace) \
printk(fmt, ##args); \ printk(fmt, ##args); \
} } while (0)
#define BCMLOG_ERR(fmt, args...) \ #define BCMLOG_ERR(fmt, args...) \
do { \ do { \
if (g_linklog_level & BCMLOG_ERROR) { \ if (g_linklog_level & BCMLOG_ERROR) \
printk(KERN_ERR "*ERR*:%s:%d: "fmt, __FILE__, __LINE__, ##args); \ printk(KERN_ERR "*ERR*:%s:%d: "fmt, \
} \ __FILE__, __LINE__, ##args); \
} while (0); } while (0)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment