From e327cf83db4985a80c8c533bb7b0adf3eee87f1a Mon Sep 17 00:00:00 2001 From: Haowen Bai Date: Wed, 30 Mar 2022 09:28:59 +0800 Subject: [PATCH] staging: r8188eu: Directly return _SUCCESS instead of using local ret variable As init_mlme_ext_priv function always returns SUCCESS , We can change return type from int to void. fixes coccinelle warning: ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:357:5-8: Unneeded variable: "res". Return "_SUCCESS" on line 380 Reviewed-by: Dan Carpenter Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1648603740-14760-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 5 +---- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- drivers/staging/r8188eu/os_dep/os_intfs.c | 6 +----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index c0a1efc..2732cdf 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -351,9 +351,8 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c return chanset_size; } -int init_mlme_ext_priv(struct adapter *padapter) +void init_mlme_ext_priv(struct adapter *padapter) { - int res = _SUCCESS; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -375,8 +374,6 @@ int init_mlme_ext_priv(struct adapter *padapter) pmlmeext->mlmeext_init = true; pmlmeext->active_keep_alive_check = true; - - return res; } void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index bab6eea..9f08103 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -395,7 +395,7 @@ struct mlme_ext_priv { u8 active_keep_alive_check; }; -int init_mlme_ext_priv(struct adapter *adapter); +void init_mlme_ext_priv(struct adapter *adapter); int init_hw_mlme_ext(struct adapter *padapter); void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); extern void init_mlme_ext_timer(struct adapter *padapter); diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index 550721e..c531504 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -490,10 +490,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) init_wifidirect_info(padapter, P2P_ROLE_DISABLE); reset_global_wifidirect_info(padapter); - if (init_mlme_ext_priv(padapter) == _FAIL) { - dev_err(dvobj_to_dev(padapter->dvobj), "init_mlme_ext_priv failed\n"); - goto free_mlme_priv; - } + init_mlme_ext_priv(padapter); if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) { dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n"); @@ -534,7 +531,6 @@ free_xmit_priv: free_mlme_ext: free_mlme_ext_priv(&padapter->mlmeextpriv); -free_mlme_priv: rtw_free_mlme_priv(&padapter->mlmepriv); free_evt_priv: -- 2.7.4