2019-11-23 15:20:06

by Michael Straube

[permalink] [raw]
Subject: [PATCH 3/3] staging: rtl8188eu: remove return variable from rtw_pwr_unassociated_idle

Function rtw_pwr_unassociated_idle returns boolean values.
Remove the return variable ret and the exit label to simplify the
function a little bit. Return true or false directly instead.

Signed-off-by: Michael Straube <[email protected]>
---
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index 8e99e10c1fd4..c4f58507dbfd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -201,21 +201,17 @@ int ips_leave(struct adapter *padapter)
static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
{
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
- bool ret = false;

if (time_after_eq(adapter->pwrctrlpriv.ips_deny_time, jiffies))
- goto exit;
+ return false;

if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) ||
check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS) ||
check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE))
- goto exit;
-
- ret = true;
+ return false;

-exit:
- return ret;
+ return true;
}

void rtw_ps_processor(struct adapter *padapter)
--
2.24.0


2019-11-23 18:04:52

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 3/3] staging: rtl8188eu: remove return variable from rtw_pwr_unassociated_idle

On 11/23/19 9:16 AM, Michael Straube wrote:
> Function rtw_pwr_unassociated_idle returns boolean values.
> Remove the return variable ret and the exit label to simplify the
> function a little bit. Return true or false directly instead.
>
> Signed-off-by: Michael Straube <[email protected]>
> ---
> drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)

Acked-by: Larry Finger <[email protected]>

Thanks,

Larry