staging: rtl8723bs: fix empty-body warning
The newly added driver causes lots of warnings like
drivers/staging/rtl8723bs/core/rtw_recv.c: In function 'validate_recv_frame':
drivers/staging/rtl8723bs/core/rtw_recv.c:1602:4: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
DBG_COUNTER(adapter->rx_logs.core_rx_pre_data_handled);
drivers/staging/rtl8723bs/core/rtw_xmit.c: In function 'update_attrib':
drivers/staging/rtl8723bs/core/rtw_xmit.c:726:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
drivers/staging/rtl8723bs/hal/HalPhyRf.c: In function 'ODM_TXPowerTrackingCallback_ThermalMeter':
drivers/staging/rtl8723bs/hal/HalPhyRf.c:146:4: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
drivers/staging/rtl8723bs/hal/HalPhyRf.c:529:6: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
drivers/staging/rtl8723bs/hal/HalPhyRf.c:559:6: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
When DBG_COUNTER() etc is defined as a non-empty macro, we get the intended
behavior and no warning. Using no_printk() for printing helper functions
as the added advantage of compile-time checking format strings
Fixes: 554c0a3abf
("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b40f7808a0
commit
c45112e467
|
@ -165,10 +165,11 @@ extern u32 GLBtcDbgType[];
|
|||
}
|
||||
|
||||
#else
|
||||
#define BTC_PRINT(dbgtype, dbgflag, printstr)
|
||||
#define BTC_PRINT_F(dbgtype, dbgflag, printstr)
|
||||
#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)
|
||||
#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)
|
||||
#define BTC_PRINT(dbgtype, dbgflag, printstr) no_printk printstr
|
||||
#define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr
|
||||
#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr
|
||||
#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \
|
||||
no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen)
|
||||
#endif
|
||||
|
||||
typedef struct _BTC_BOARD_INFO {
|
||||
|
|
|
@ -151,13 +151,14 @@
|
|||
DbgPrint("\n");\
|
||||
}
|
||||
#else
|
||||
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)
|
||||
#define ODM_dbg_enter()
|
||||
#define ODM_dbg_exit()
|
||||
#define ODM_dbg_trace(str)
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)
|
||||
#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_ASSERT(pDM_Odm, expr, fmt) no_printk fmt
|
||||
#define ODM_dbg_enter() do {} while (0)
|
||||
#define ODM_dbg_exit() do {} while (0)
|
||||
#define ODM_dbg_trace(str) no_printk("%s", str)
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
|
||||
no_printk("%s %p", title_str, ptr)
|
||||
#endif
|
||||
|
||||
void ODM_InitDebugSetting(PDM_ODM_T pDM_Odm);
|
||||
|
|
|
@ -263,7 +263,7 @@
|
|||
#ifdef CONFIG_DBG_COUNTER
|
||||
#define DBG_COUNTER(counter) counter++
|
||||
#else
|
||||
#define DBG_COUNTER(counter)
|
||||
#define DBG_COUNTER(counter) do {} while (0)
|
||||
#endif
|
||||
|
||||
void dump_drv_version(void *sel);
|
||||
|
|
Loading…
Reference in New Issue