linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Change function return type to void
@ 2019-06-22 16:40 Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() " Shobhit Kukreti
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shobhit Kukreti @ 2019-06-22 16:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Bastien Nocera, Hans de Goede, Larry Finger
  Cc: devel, linux-kernel, Shobhit Kukreti

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(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() to void
  2019-06-22 16:40 [PATCH 0/3] Change function return type to void Shobhit Kukreti
@ 2019-06-22 16:40 ` Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 2/3] staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() " Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 3/3] staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() " Shobhit Kukreti
  2 siblings, 0 replies; 4+ messages in thread
From: Shobhit Kukreti @ 2019-06-22 16:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Bastien Nocera, Hans de Goede, Larry Finger
  Cc: devel, linux-kernel, Shobhit Kukreti

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..

Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 8a9d838..e1e871e 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() to void
  2019-06-22 16:40 [PATCH 0/3] Change function return type to void Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() " Shobhit Kukreti
@ 2019-06-22 16:40 ` Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 3/3] staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() " Shobhit Kukreti
  2 siblings, 0 replies; 4+ messages in thread
From: Shobhit Kukreti @ 2019-06-22 16:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Bastien Nocera, Hans de Goede, Larry Finger
  Cc: devel, linux-kernel, Shobhit Kukreti

Changed 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.

Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>
---
 drivers/staging/rtl8723bs/include/drv_types.h | 2 +-
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 0fd84c9..96346ce 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -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
 
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index e1e871e..6b26af3 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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 */
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() to void
  2019-06-22 16:40 [PATCH 0/3] Change function return type to void Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() " Shobhit Kukreti
  2019-06-22 16:40 ` [PATCH 2/3] staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() " Shobhit Kukreti
@ 2019-06-22 16:40 ` Shobhit Kukreti
  2 siblings, 0 replies; 4+ messages in thread
From: Shobhit Kukreti @ 2019-06-22 16:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Bastien Nocera, Hans de Goede, Larry Finger
  Cc: devel, linux-kernel, Shobhit Kukreti

rtw_init_default_value() func always returns a value (u8)_SUCCESS.
Modified return type to void to resolve coccicheck warnings
of unneeded variable.

Signed-off-by: Shobhit Kukreti <shobhitkukreti@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 6b26af3..22d4461 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-22 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-22 16:40 [PATCH 0/3] Change function return type to void Shobhit Kukreti
2019-06-22 16:40 ` [PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() " Shobhit Kukreti
2019-06-22 16:40 ` [PATCH 2/3] staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() " Shobhit Kukreti
2019-06-22 16:40 ` [PATCH 3/3] staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() " Shobhit Kukreti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).