Change function return type to void
cover Change function return type to void
This patchset modifies function return types to void. The return values of the function are never checked and they always return success.
This resolves coccicheck Unneeded variable warnings.
PATCH[1/3]: This patch changes return type of rtw_suspend_normal() to void
PATCH[2/3]: This patch changes return type of rtw_suspend_wow() to void
PATCH[3/3]: This patch changes return type of rtw_init_default_value to void
Shobhit Kukreti (3):
staging: rtl8723bs: os_dep: Change return type of function
rtw_suspend_normal() to void
staging: rtl8723bs: os_dep: modified return type of function
rtw_suspend_wow() to void
staging: rtl8723bs: os_dep: Change return type of
rtw_init_default_value() to void
drivers/staging/rtl8723bs/include/drv_types.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() to void
Coccicheck issues Unneeded variable "ret" warning.
The return value of function rtw_suspend_normal() is set to _SUCCESS. The return value is never never checked by the calling function. Modified return type to void to remove the coccicheck warning..
--- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -3
@@ -1422,10 +1422,9 @@ int rtw_suspend_ap_wow(struct adapter *padapter)#endif /* ifdef CONFIG_AP_WOWLAN */ -static int rtw_suspend_normal (struct adapter *padapter) +static void rtw_suspend_normal (struct adapter *padapter) {struct net_device *pnetdev = padapter->pnetdev; -int ret = _SUCCESS;DBG_871X ("==> " FUNC_ADPT_FMT " entry....\n" ,FUNC_ADPT_ARG (padapter));if (pnetdev) {
@@ -1447,7 +1446,6 @@ static int rtw_suspend_normal(struct adapter *padapter) padapter->intf_deinit (adapter_to_dvobj (padapter));DBG_871X ("<== " FUNC_ADPT_FMT " exit....\n" ,FUNC_ADPT_ARG (padapter)); -return ret; }int rtw_suspend_common (struct adapter *padapter)
Signature · 1 line
2.7.4
PATCH 2/3 staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() to void
In reply to Shobhit KukretiChanged return type of function rtw_suspend_wow() to void. The function always return _SUCCESS and the value is never checked in the calling function.
Resolves coccicheck Unneeded variable "ret" warning.
--- drivers/staging/rtl8723bs/include/drv_types.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/include/drv_types.h +1 -1
@@ -673,7 +673,7 @@ int rtw_config_gpio(struct net_device *netdev, int gpio_num, bool isOutput);#endif #ifdef CONFIG_WOWLAN -int rtw_suspend_wow (struct adapter *padapter); +void rtw_suspend_wow (struct adapter *padapter);int rtw_resume_process_wow (struct adapter *padapter);#endif
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -3
@@ -1289,14 +1289,13 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter) }#ifdef CONFIG_WOWLAN -int rtw_suspend_wow (struct adapter *padapter) +void rtw_suspend_wow (struct adapter *padapter) {u8 ch, bw, offset;struct mlme_priv *pmlmepriv = &padapter->mlmepriv;struct net_device *pnetdev = padapter->pnetdev;struct pwrctrl_priv *pwrpriv =adapter_to_pwrctl (padapter);struct wowlan_ioctl_param poidparam; -int ret = _SUCCESS;DBG_871X ("==> " FUNC_ADPT_FMT " entry....\n" ,FUNC_ADPT_ARG (padapter));
@@ -1364,7 +1363,6 @@ int rtw_suspend_wow(struct adapter *padapter) DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR ### wowlan_mode =%d\n", __func__, pwrpriv->wowlan_mode); }DBG_871X ("<== " FUNC_ADPT_FMT " exit....\n" ,FUNC_ADPT_ARG (padapter)); -return ret; }#endif /* ifdef CONFIG_WOWLAN */
Signature · 1 line
2.7.4
PATCH 3/3 staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() to void
In reply to Shobhit Kukretirtw_init_default_value() func always returns a value (u8)_SUCCESS. Modified return type to void to resolve coccicheck warnings of unneeded variable.
--- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -4
@@ -601,9 +601,8 @@ void rtw_stop_drv_threads (struct adapter *padapter)rtw_hal_stop_thread (padapter); } -static u8 rtw_init_default_value (struct adapter *padapter) +static void rtw_init_default_value (struct adapter *padapter) { -u8 ret = _SUCCESS;struct registry_priv *pregistrypriv = &padapter->registrypriv;struct xmit_priv *pxmitpriv = &padapter->xmitpriv;struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -665,7 +664,6 @@ static u8 rtw_init_default_value(struct adapter *padapter) padapter->driver_ampdu_spacing =0xFF ; padapter->driver_rx_ampdu_factor =0xFF ; -return ret; }struct dvobj_priv *devobj_init (void )
@@ -749,7 +747,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)RT_TRACE (_module_os_intfs_c_, _drv_info_, ("+rtw_init_drv_sw\n" )); - ret8 =rtw_init_default_value (padapter); +rtw_init_default_value (padapter);rtw_init_hal_com_default_value (padapter);
Signature · 1 line
2.7.4