Remove function rtw_btcoex_IsBtControlLps as it does nothing except call hal_btcoex_IsBtControlLps. Modify call sites accordingly. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx> --- drivers/staging/rtl8723bs/core/rtw_btcoex.c | 5 ----- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 5 +++-- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 22 +++++++++---------- drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 2 +- .../staging/rtl8723bs/include/rtw_btcoex.h | 1 - 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_btcoex.c b/drivers/staging/rtl8723bs/core/rtw_btcoex.c index 9a6e0cb9f1cc..bcbe8a441074 100644 --- a/drivers/staging/rtl8723bs/core/rtw_btcoex.c +++ b/drivers/staging/rtl8723bs/core/rtw_btcoex.c @@ -67,11 +67,6 @@ s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter) return coexctrl; } -u8 rtw_btcoex_IsBtControlLps(struct adapter *padapter) -{ - return hal_btcoex_IsBtControlLps(padapter); -} - void rtw_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist) { hal_btcoex_SetBTCoexist(padapter, bBtExist); diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 77d22f403b52..41346b101f1d 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -1595,7 +1595,7 @@ static void rtw_lps_change_dtim_hdl(struct adapter *padapter, u8 dtim) if (dtim <= 0 || dtim > 16) return; - if (rtw_btcoex_IsBtControlLps(padapter) == true) + if (hal_btcoex_IsBtControlLps(padapter) == true) return; mutex_lock(&pwrpriv->lock); diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 542a5fe33f1d..1ebde6e8880a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -9,6 +9,7 @@ #include <linux/etherdevice.h> #include <drv_types.h> #include <rtw_debug.h> +#include <hal_btcoex.h> #include <linux/jiffies.h> extern u8 rtw_do_join(struct adapter *padapter); @@ -1888,10 +1889,10 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter) return; if (is_primary_adapter(adapter)) - DBG_871X("IsBtDisabled =%d, IsBtControlLps =%d\n", rtw_btcoex_IsBtDisabled(adapter), rtw_btcoex_IsBtControlLps(adapter)); + DBG_871X("IsBtDisabled =%d, IsBtControlLps =%d\n", rtw_btcoex_IsBtDisabled(adapter), hal_btcoex_IsBtControlLps(adapter)); if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode == true) - && (rtw_btcoex_IsBtControlLps(adapter) == false) + && (hal_btcoex_IsBtControlLps(adapter) == false) ) { u8 bEnterPS; diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index 09e064f1211b..3fb8c65fb72a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -221,7 +221,7 @@ void traffic_check_for_leave_lps(struct adapter *padapter, u8 tx, u32 tx_packets if (xmit_cnt > 8) { if ((adapter_to_pwrctl(padapter)->bLeisurePs) && (adapter_to_pwrctl(padapter)->pwr_mode != PS_MODE_ACTIVE) - && (rtw_btcoex_IsBtControlLps(padapter) == false) + && (hal_btcoex_IsBtControlLps(padapter) == false) ) { DBG_871X("leave lps via Tx = %d\n", xmit_cnt); bLeaveLPS = true; @@ -236,7 +236,7 @@ void traffic_check_for_leave_lps(struct adapter *padapter, u8 tx, u32 tx_packets if (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 4/*2*/) { if ((adapter_to_pwrctl(padapter)->bLeisurePs) && (adapter_to_pwrctl(padapter)->pwr_mode != PS_MODE_ACTIVE) - && (rtw_btcoex_IsBtControlLps(padapter) == false) + && (hal_btcoex_IsBtControlLps(padapter) == false) ) { DBG_871X("leave lps via Rx = %d\n", pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod); bLeaveLPS = true; @@ -418,9 +418,9 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a /* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */ if (ps_mode == PS_MODE_ACTIVE) { if (1 - && (((rtw_btcoex_IsBtControlLps(padapter) == false) + && (((hal_btcoex_IsBtControlLps(padapter) == false) ) - || ((rtw_btcoex_IsBtControlLps(padapter) == true) + || ((hal_btcoex_IsBtControlLps(padapter) == true) && (hal_btcoex_IsLpsOn(padapter) == false)) ) ) { @@ -461,7 +461,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a } } else { if ((PS_RDY_CHECK(padapter) && check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE)) - || ((rtw_btcoex_IsBtControlLps(padapter) == true) + || ((hal_btcoex_IsBtControlLps(padapter) == true) && (hal_btcoex_IsLpsOn(padapter) == true)) ) { u8 pslv; @@ -482,7 +482,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a pslv = PS_STATE_S0; if ((rtw_btcoex_IsBtDisabled(padapter) == false) - && (rtw_btcoex_IsBtControlLps(padapter) == true)) { + && (hal_btcoex_IsBtControlLps(padapter) == true)) { u8 val8; val8 = hal_btcoex_LpsVal(padapter); @@ -544,7 +544,7 @@ void LPS_Enter(struct adapter *padapter, const char *msg) int n_assoc_iface = 0; char buf[32] = {0}; - if (rtw_btcoex_IsBtControlLps(padapter) == true) + if (hal_btcoex_IsBtControlLps(padapter) == true) return; /* Skip lps enter request if number of assocated adapters is not 1 */ @@ -589,7 +589,7 @@ void LPS_Leave(struct adapter *padapter, const char *msg) /* DBG_871X("+LeisurePSLeave\n"); */ - if (rtw_btcoex_IsBtControlLps(padapter) == true) + if (hal_btcoex_IsBtControlLps(padapter) == true) return; if (pwrpriv->bLeisurePs) { @@ -911,7 +911,7 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task) pslv = PS_STATE_S0; if ((rtw_btcoex_IsBtDisabled(padapter) == false) - && (rtw_btcoex_IsBtControlLps(padapter) == true)) { + && (hal_btcoex_IsBtControlLps(padapter) == true)) { u8 val8; val8 = hal_btcoex_LpsVal(padapter); @@ -1052,7 +1052,7 @@ void rtw_unregister_tx_alive(struct adapter *padapter) pslv = PS_STATE_S0; if ((rtw_btcoex_IsBtDisabled(padapter) == false) - && (rtw_btcoex_IsBtControlLps(padapter) == true)) { + && (hal_btcoex_IsBtControlLps(padapter) == true)) { u8 val8; val8 = hal_btcoex_LpsVal(padapter); @@ -1094,7 +1094,7 @@ void rtw_unregister_cmd_alive(struct adapter *padapter) pslv = PS_STATE_S0; if ((rtw_btcoex_IsBtDisabled(padapter) == false) - && (rtw_btcoex_IsBtControlLps(padapter) == true)) { + && (hal_btcoex_IsBtControlLps(padapter) == true)) { u8 val8; val8 = hal_btcoex_LpsVal(padapter); diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index 87e85968d2e1..080e974914b6 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -1044,7 +1044,7 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode) } if (psmode > 0) { - if (rtw_btcoex_IsBtControlLps(padapter) == true) { + if (hal_btcoex_IsBtControlLps(padapter) == true) { PowerState = hal_btcoex_RpwmVal(padapter); byte5 = hal_btcoex_LpsVal(padapter); diff --git a/drivers/staging/rtl8723bs/include/rtw_btcoex.h b/drivers/staging/rtl8723bs/include/rtw_btcoex.h index 73864262f9bc..7b4cc8505a38 100644 --- a/drivers/staging/rtl8723bs/include/rtw_btcoex.h +++ b/drivers/staging/rtl8723bs/include/rtw_btcoex.h @@ -22,7 +22,6 @@ void rtw_btcoex_BtInfoNotify(struct adapter *, u8 length, u8 *tmpBuf); void rtw_btcoex_HaltNotify(struct adapter *); u8 rtw_btcoex_IsBtDisabled(struct adapter *); s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *); -u8 rtw_btcoex_IsBtControlLps(struct adapter *); void rtw_btcoex_SetBTCoexist(struct adapter *, u8 bBtExist); void rtw_btcoex_SetChipType(struct adapter *, u8 chipType); void rtw_btcoex_SetPGAntNum(struct adapter *, u8 antNum); -- 2.19.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel