I ran into this warning during randconfig testing:
drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable]
drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable]
The problem is that the code procfs code gets built even when CONFIG_PROC_FS
is disabled, but some functions are turned into empty stubs then. This
is easily addressed by adding an #ifdef around the definition of the
CONFIG_PROC_DEBUG macro.
However, I could not bear looking at the macro name that clashes with the
Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with
the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same
way. This is consistent with how we handle the same checks in the non-staging
rtlwifi driver.
As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it
turned out to be incorrect and requires adding 'static inline' annotations
for the stub handlers, and moving some variables around.
Fixes:
554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return res;
}
+u32 g_wait_hiq_empty = 0;
+
static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
{
struct sta_info *psta_bmc;
u32 GlobalDebugLevel = _drv_err_;
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
u64 GlobalDebugComponents = \
_module_rtl871x_xmit_c_ |
_module_mp_ |
_module_efuse_;
-#endif /* CONFIG_DEBUG_RTL871X */
+#endif /* DEBUG_RTL871X */
#include <rtw_version.h>
}
}
-#ifdef CONFIG_PROC_DEBUG
+#ifdef PROC_DEBUG
ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
struct net_device *dev = data;
return count;
}
-u8 g_fwdl_chksum_fail = 0;
-u8 g_fwdl_wintint_rdy_fail = 0;
-
ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
char tmp[32];
return count;
}
-u32 g_wait_hiq_empty = 0;
-
ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
{
char tmp[32];
}
chplan_ap.Len = i;
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
i = 0;
DBG_871X("%s: AP[%s] channel plan {", __func__, bssid->Ssid.Ssid);
while ((i < chplan_ap.Len) && (chplan_ap.Channel[i] != 0)) {
#endif
memcpy(chplan_sta, pmlmeext->channel_set, sizeof(chplan_sta));
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
i = 0;
DBG_871X("%s: STA channel plan {", __func__);
while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) {
pmlmeext->update_channel_plan_by_ap_done = 1;
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
k = 0;
DBG_871X("%s: new STA channel plan {", __func__);
while ((k < MAX_CHANNEL_NUM) && (chplan_new[k].ChannelNum != 0)) {
DBG_8192C("+" FUNC_ADPT_FMT ": iface_type =%d fw_state = 0x%08X\n",
FUNC_ADPT_ARG(padapter), get_iface_type(padapter), get_fwstate(&padapter->mlmepriv));
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == false) {
DBG_8192C(FUNC_ADPT_FMT ": [WARNING] not in AP mode!!\n",
FUNC_ADPT_ARG(padapter));
}
-#endif /* CONFIG_DEBUG */
+#endif /* DEBUG */
pHalData = GET_HAL_DATA(padapter);
pmlmeext = &padapter->mlmeextpriv;
DBG_8192C("%s: Finish\n", __func__);
}
+u8 g_fwdl_chksum_fail = 0;
+
static s32 polling_fwdl_chksum(
struct adapter *adapter, u32 min_cnt, u32 timeout_ms
)
return ret;
}
+u8 g_fwdl_wintint_rdy_fail = 0;
+
static s32 _FWFreeToGo(struct adapter *adapter, u32 min_cnt, u32 timeout_ms)
{
s32 ret = _FAIL;
memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN);
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
if (0) {
for (i = 0; i < 256; i++)
efuse_OneByteRead(padapter, i, &efuseTbl[i], false);
for (i = 0; i < _size_byte; i++)
pbuf[i] = efuseTbl[_offset+i];
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
if (1) {
DBG_871X("Efuse Realmap:\n");
for (i = 0; i < _size_byte; i++) {
pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
}
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("======= Path %d, ChannelIndex %d, Group %d =======\n", rfPath, ch, group));
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]));
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]));
pHalData->BW20_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW20_Diff[rfPath][TxCount];
pHalData->BW40_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW40_Diff[rfPath][TxCount];
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("--------------------------------------- 2.4G ---------------------------------------\n"));
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("CCK_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->CCK_24G_Diff[rfPath][TxCount]));
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("OFDM_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->OFDM_24G_Diff[rfPath][TxCount]));
/*
* Functions Config
*/
-/* define CONFIG_DEBUG_CFG80211 */
+/* define DEBUG_CFG80211 */
#ifndef CONFIG_WIRELESS_EXT
#error CONFIG_WIRELESS_EXT needs to be enabled for this driver to work
/*
* Debug Related Config
*/
-#undef CONFIG_DEBUG
+#undef DEBUG
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
#define DBG 1 /* for ODM & BTCOEX debug */
-/*#define CONFIG_DEBUG_RTL871X */
-#else /* !CONFIG_DEBUG */
+/*#define DEBUG_RTL871X */
+#else /* !DEBUG */
#define DBG 0 /* for ODM & BTCOEX debug */
-#endif /* !CONFIG_DEBUG */
+#endif /* !DEBUG */
-#define CONFIG_PROC_DEBUG
+#ifdef CONFIG_PROC_FS
+#define PROC_DEBUG
+#endif
/* define DBG_XMIT_BUF */
/* define DBG_XMIT_BUF_EXT */
#endif /* defined(_dbgdump) */
-#ifdef CONFIG_DEBUG
+#ifdef DEBUG
#if defined(_dbgdump)
#undef DBG_871X
#define DBG_871X(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while (0)
#endif /* defined(_dbgdump) */
-#endif /* CONFIG_DEBUG */
+#endif /* DEBUG */
-#ifdef CONFIG_DEBUG_RTL871X
+#ifdef DEBUG_RTL871X
#if defined(_dbgdump) && defined(_MODULE_DEFINE_)
_dbgdump("\n"); \
}
#endif /* defined(_dbgdump) */
-#endif /* CONFIG_DEBUG_RTL871X */
+#endif /* DEBUG_RTL871X */
#ifdef CONFIG_DBG_COUNTER
#define DBG_COUNTER(counter) counter++
void bb_reg_dump(void *sel, struct adapter *adapter);
void rf_reg_dump(void *sel, struct adapter *adapter);
-#ifdef CONFIG_PROC_DEBUG
+#ifdef PROC_DEBUG
ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
int proc_get_read_reg(struct seq_file *m, void *v);
ssize_t proc_set_read_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
int proc_get_int_logs(struct seq_file *m, void *v);
#endif
-#endif /* CONFIG_PROC_DEBUG */
+#endif /* PROC_DEBUG */
#endif /* __RTW_DEBUG_H__ */
goto exit;
}
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_871X(FUNC_NDEV_FMT" mac ="MAC_FMT"\n", FUNC_NDEV_ARG(ndev), MAC_ARG(mac));
#endif
spin_lock_bh(&pwdev_priv->scan_req_lock);
if (pwdev_priv->scan_request != NULL) {
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_871X("%s with scan req\n", __func__);
#endif
pwdev_priv->scan_request = NULL;
} else {
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_871X("%s without scan req\n", __func__);
#endif
}
struct __queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL;
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_8192C("%s\n", __func__);
#endif
u8 *wps_ie;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_8192C("%s, ielen =%d\n", __func__, len);
#endif
{
if ((wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen)))
{
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_8192C("probe_req_wps_ielen =%d\n", wps_ielen);
#endif
pwdev_priv = adapter_wdev_data(padapter);
pmlmepriv = &padapter->mlmepriv;
-/* ifdef CONFIG_DEBUG_CFG80211 */
+/* ifdef DEBUG_CFG80211 */
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
/* endif */
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
{
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_871X("%s under WIFI_AP_STATE\n", __func__);
#endif
memset(ssid, 0, sizeof(struct ndis_802_11_ssid)*RTW_SSID_SCAN_AMOUNT);
/* parsing request ssids, n_ssids */
for (i = 0; i < request->n_ssids && i < RTW_SSID_SCAN_AMOUNT; i++) {
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_8192C("ssid =%s, len =%d\n", ssids[i].ssid, ssids[i].ssid_len);
#endif
memcpy(ssid[i].Ssid, ssids[i].ssid, ssids[i].ssid_len);
/* parsing channels, n_channels */
memset(ch, 0, sizeof(struct rtw_ieee80211_channel)*RTW_CHANNEL_SCAN_AMOUNT);
for (i = 0;i<request->n_channels && i<RTW_CHANNEL_SCAN_AMOUNT;i++) {
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_871X(FUNC_ADPT_FMT CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(request->channels[i]));
#endif
ch[i].hw_value = request->channels[i]->hw_value;
ack = false;
ret = _FAIL;
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_8192C("%s, ack == _FAIL\n", __func__);
#endif
}
msleep(50);
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_8192C("%s, ack =%d, ok!\n", __func__, ack);
#endif
ret = _SUCCESS;
exit:
- #ifdef CONFIG_DEBUG_CFG80211
+ #ifdef DEBUG_CFG80211
DBG_8192C("%s, ret =%d\n", __func__, ret);
#endif
/* cookie generation */
*cookie = (unsigned long) buf;
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_871X(FUNC_ADPT_FMT" len =%zu, ch =%d"
"\n", FUNC_ADPT_ARG(padapter),
len, tx_ch
);
-#endif /* CONFIG_DEBUG_CFG80211 */
+#endif /* DEBUG_CFG80211 */
/* indicate ack before issue frame to avoid racing with rsp frame */
rtw_cfg80211_mgmt_tx_status(padapter, *cookie, buf, len, ack, GFP_KERNEL);
adapter = (struct adapter *)rtw_netdev_priv(ndev);
-#ifdef CONFIG_DEBUG_CFG80211
+#ifdef DEBUG_CFG80211
DBG_871X(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
frame_type, reg);
#endif
char *extra)
{
-#ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV
+#ifdef DEBUG_RTW_WX_SET_PRIV
char *ext_dbg;
#endif
/* ("rtw_wx_set_priv: %s req =%s\n", */
/* dev->name, ext)); */
- #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV
+ #ifdef DEBUG_RTW_WX_SET_PRIV
if (!(ext_dbg = vmalloc(len)))
{
vfree(ext, len);
FREE_EXT:
vfree(ext);
- #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV
+ #ifdef DEBUG_RTW_WX_SET_PRIV
vfree(ext_dbg);
#endif
#include <rtw_debug.h>
#include "rtw_proc.h"
-#ifdef CONFIG_PROC_DEBUG
+#ifdef PROC_DEBUG
static struct proc_dir_entry *rtw_proc = NULL;
}
-#endif /* CONFIG_PROC_DEBUG */
+#endif /* PROC_DEBUG */
ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
};
-#ifdef CONFIG_PROC_DEBUG
+#ifdef PROC_DEBUG
int rtw_drv_proc_init(void);
void rtw_drv_proc_deinit(void);
void rtw_adapter_proc_deinit(struct net_device *dev);
void rtw_adapter_proc_replace(struct net_device *dev);
-#else //!CONFIG_PROC_DEBUG
+#else //!PROC_DEBUG
-int rtw_drv_proc_init(void) {return 0;}
-void rtw_drv_proc_deinit(void) {}
-struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev){return NULL;}
-void rtw_adapter_proc_deinit(struct net_device *dev){}
-void rtw_adapter_proc_replace(struct net_device *dev){}
+static inline int rtw_drv_proc_init(void) {return 0;}
+static inline void rtw_drv_proc_deinit(void) {}
+static inline struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev){return NULL;}
+static inline void rtw_adapter_proc_deinit(struct net_device *dev){}
+static inline void rtw_adapter_proc_replace(struct net_device *dev){}
-#endif //!CONFIG_PROC_DEBUG
+#endif //!PROC_DEBUG
#endif //__RTW_PROC_H__