Commit e803a374 authored by Justin Vreeland's avatar Justin Vreeland Committed by Greg Kroah-Hartman

staging: rtl8723bs: Wrap multi-line macros in do-while loop

Wrapping in do-while ensures macros are executed as expected.
Signed-off-by: default avatarJustin Vreeland <justin@jvreeland.com>
Reviewed-by: default avatarBastien Nocera <hadess@hadess.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 318dda31
...@@ -105,51 +105,60 @@ ...@@ -105,51 +105,60 @@
#if DBG #if DBG
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\ #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\
if (\ do {\
(comp & pDM_Odm->DebugComponents) &&\ if (\
(level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)\ (comp & pDM_Odm->DebugComponents) &&\
) {\ (level <= pDM_Odm->DebugLevel ||\
RT_PRINTK fmt;\ level == ODM_DBG_SERIOUS)\
} ) {\
RT_PRINTK fmt;\
} \
} while (0)
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\ #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\
if (\ do {\
(comp & pDM_Odm->DebugComponents) &&\ if (\
(level <= pDM_Odm->DebugLevel)\ (comp & pDM_Odm->DebugComponents) &&\
) {\ (level <= pDM_Odm->DebugLevel)\
RT_PRINTK fmt;\ ) {\
} RT_PRINTK fmt;\
} \
} while (0)
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\ #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\
if (!expr) {\ do {\
DbgPrint("Assertion failed! %s at ......\n", #expr);\ if (!expr) {\
DbgPrint(\ DbgPrint("Assertion failed! %s at ......\n", #expr);\
" ......%s,%s, line =%d\n",\ DbgPrint(\
__FILE__,\ " ......%s,%s, line =%d\n",\
__func__,\ __FILE__,\
__LINE__\ __func__,\
);\ __LINE__\
RT_PRINTK fmt;\ );\
ASSERT(false);\ RT_PRINTK fmt;\
} ASSERT(false);\
} \
} while (0)
#define ODM_dbg_enter() { DbgPrint("==> %s\n", __func__); } #define ODM_dbg_enter() { DbgPrint("==> %s\n", __func__); }
#define ODM_dbg_exit() { DbgPrint("<== %s\n", __func__); } #define ODM_dbg_exit() { DbgPrint("<== %s\n", __func__); }
#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); }
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\ #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\
if (\ do {\
(comp & pDM_Odm->DebugComponents) &&\ if (\
(level <= pDM_Odm->DebugLevel)\ (comp & pDM_Odm->DebugComponents) &&\
) {\ (level <= pDM_Odm->DebugLevel)\
int __i;\ ) {\
u8 *__ptr = (u8 *)ptr;\ int __i;\
DbgPrint("[ODM] ");\ u8 *__ptr = (u8 *)ptr;\
DbgPrint(title_str);\ DbgPrint("[ODM] ");\
DbgPrint(" ");\ DbgPrint(title_str);\
for (__i = 0; __i < 6; __i++)\ DbgPrint(" ");\
DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\ for (__i = 0; __i < 6; __i++)\
DbgPrint("\n");\ DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\
} DbgPrint("\n");\
} \
} while (0)
#else #else
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) no_printk fmt #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) no_printk fmt
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) no_printk fmt #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) no_printk fmt
......
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