rtlwifi: Neaten RT_ASSERT, RT_TRACE, RTPRINT, RT_PRINT_DATA macros
Make the macros a bit more readable. Use do {...} while (0) without terminating semicolons. Add missing terminating semicolon to a few uses. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
3084f3b65c
commit
884dd24499
@@ -156,53 +156,47 @@ enum dbgp_flag_e {
|
||||
DBGP_TYPE_MAX
|
||||
};
|
||||
|
||||
#define RT_ASSERT(_exp, fmt) \
|
||||
do { \
|
||||
if (!(_exp)) { \
|
||||
printk(KERN_DEBUG "%s:%s(): ", KBUILD_MODNAME, \
|
||||
__func__); \
|
||||
printk fmt; \
|
||||
} \
|
||||
} while (0);
|
||||
#define RT_ASSERT(_exp, fmt) \
|
||||
do { \
|
||||
if (!(_exp)) { \
|
||||
printk(KERN_DEBUG "%s:%s(): ", \
|
||||
KBUILD_MODNAME, __func__); \
|
||||
printk fmt; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RT_TRACE(rtlpriv, comp, level, fmt)\
|
||||
do { \
|
||||
if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
|
||||
((level) <= rtlpriv->dbg.global_debuglevel))) {\
|
||||
printk(KERN_DEBUG "%s:%s():<%lx-%x> ", KBUILD_MODNAME, \
|
||||
__func__, in_interrupt(), in_atomic()); \
|
||||
printk fmt; \
|
||||
} \
|
||||
} while (0);
|
||||
#define RT_TRACE(rtlpriv, comp, level, fmt) \
|
||||
do { \
|
||||
if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) && \
|
||||
((level) <= rtlpriv->dbg.global_debuglevel))) { \
|
||||
printk(KERN_DEBUG "%s:%s():<%lx-%x> ", \
|
||||
KBUILD_MODNAME, __func__, \
|
||||
in_interrupt(), in_atomic()); \
|
||||
printk fmt; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RTPRINT(rtlpriv, dbgtype, dbgflag, printstr) \
|
||||
do { \
|
||||
if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
|
||||
printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
|
||||
printk printstr; \
|
||||
} \
|
||||
} while (0);
|
||||
#define RTPRINT(rtlpriv, dbgtype, dbgflag, printstr) \
|
||||
do { \
|
||||
if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
|
||||
printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
|
||||
printk printstr; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
|
||||
_hexdatalen) \
|
||||
do {\
|
||||
if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) &&\
|
||||
(_level <= rtlpriv->dbg.global_debuglevel))) { \
|
||||
int __i; \
|
||||
u8* ptr = (u8 *)_hexdata; \
|
||||
printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
|
||||
printk("In process \"%s\" (pid %i):", current->comm,\
|
||||
current->pid); \
|
||||
printk(_titlestring); \
|
||||
for (__i = 0; __i < (int)_hexdatalen; __i++) { \
|
||||
printk("%02X%s", ptr[__i], (((__i + 1) % 4)\
|
||||
== 0) ? " " : " ");\
|
||||
if (((__i + 1) % 16) == 0) \
|
||||
printk("\n"); \
|
||||
} \
|
||||
printk(KERN_DEBUG "\n"); \
|
||||
} \
|
||||
} while (0);
|
||||
#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
|
||||
_hexdatalen) \
|
||||
do { \
|
||||
if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) && \
|
||||
(_level <= rtlpriv->dbg.global_debuglevel))) { \
|
||||
printk(KERN_DEBUG "%s: ", KBUILD_MODNAME); \
|
||||
pr_cont("In process \"%s\" (pid %i):", \
|
||||
current->comm, current->pid); \
|
||||
printk(_titlestring); \
|
||||
print_hex_dump_bytes("", DUMP_PREFIX_NONE, \
|
||||
_hexdata, _hexdatalen); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void rtl_dbgp_flag_init(struct ieee80211_hw *hw);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user