diff options
author | Arnd Bergmann | 2017-04-21 22:59:16 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-04-28 12:10:51 +0200 |
commit | f55a6d457b215e5a382d6001a166ae2089fc81b6 (patch) | |
tree | f0f11c5f379ecc92ac54d5d518b6e4477bfadd58 /drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | |
parent | staging: rtl8723bs: fix empty-body warning (diff) | |
download | kernel-qcow2-linux-f55a6d457b215e5a382d6001a166ae2089fc81b6.tar.gz kernel-qcow2-linux-f55a6d457b215e5a382d6001a166ae2089fc81b6.tar.xz kernel-qcow2-linux-f55a6d457b215e5a382d6001a166ae2089fc81b6.zip |
staging: rtl8723bs: rework debug configuration handling
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>
Diffstat (limited to 'drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c')
-rw-r--r-- | drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 52aa65bfd890..3b7573959312 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1261,7 +1261,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, 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 @@ -1396,7 +1396,7 @@ void rtw_cfg80211_indicate_scan_done(struct adapter *adapter, bool aborted) 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 @@ -1412,7 +1412,7 @@ void rtw_cfg80211_indicate_scan_done(struct adapter *adapter, bool aborted) pwdev_priv->scan_request = NULL; } else { - #ifdef CONFIG_DEBUG_CFG80211 + #ifdef DEBUG_CFG80211 DBG_871X("%s without scan req\n", __func__); #endif } @@ -1446,7 +1446,7 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter) struct __queue *queue = &(pmlmepriv->scanned_queue); struct wlan_network *pnetwork = NULL; -#ifdef CONFIG_DEBUG_CFG80211 +#ifdef DEBUG_CFG80211 DBG_8192C("%s\n", __func__); #endif @@ -1486,7 +1486,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b 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 @@ -1494,7 +1494,7 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *b { 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 @@ -1548,7 +1548,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy 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 */ @@ -1558,7 +1558,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy 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 @@ -1621,7 +1621,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy 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); @@ -1631,7 +1631,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy /* 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; @@ -3105,7 +3105,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b ack = false; ret = _FAIL; - #ifdef CONFIG_DEBUG_CFG80211 + #ifdef DEBUG_CFG80211 DBG_8192C("%s, ack == _FAIL\n", __func__); #endif } @@ -3114,7 +3114,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b msleep(50); - #ifdef CONFIG_DEBUG_CFG80211 + #ifdef DEBUG_CFG80211 DBG_8192C("%s, ack =%d, ok!\n", __func__, ack); #endif ret = _SUCCESS; @@ -3122,7 +3122,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b exit: - #ifdef CONFIG_DEBUG_CFG80211 + #ifdef DEBUG_CFG80211 DBG_8192C("%s, ret =%d\n", __func__, ret); #endif @@ -3161,12 +3161,12 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, /* 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); @@ -3234,7 +3234,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, 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 |