Skip to contentSkip to conversation

staging: rtl8723bs: os_dep: remove unneeded variable ret

PATCH In review Saurav Girepunje 2 participants 3 messages Apr 18, 2021 – Apr 27, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: os_dep: remove unneeded variable ret

Fix the following coccicheck warning:

drivers/staging/rtl8723bs/os_dep/os_intfs.c:1156:5-8:
Unneeded variable: "ret". Return "0" on line 1199

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 1f34cb2e367c..920ec25c9a4f 100644
@@ -1153,7 +1153,6 @@ int rtw_suspend_common(struct adapter *padapter)
 	struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	int ret = 0;
 	unsigned long start_time = jiffies;
 
 	DBG_871X_LEVEL(_drv_always_, " suspend start\n");
@@ -1196,7 +1195,7 @@ int rtw_suspend_common(struct adapter *padapter)
 
 exit:
 
-	return ret;
+	return 0;
 }
 
 static int rtw_resume_process_normal(struct adapter *padapter)
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 35 lines · Saurav Girepunje

Fix the following coccicheck warning:

drivers/staging/rtl8723bs/os_dep/os_intfs.c:1156:5-8:
Unneeded variable: "ret". Return "0" on line 1199

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 1f34cb2e367c..920ec25c9a4f 100644
@@ -1153,7 +1153,6 @@ int rtw_suspend_common(struct adapter *padapter)
 	struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	int ret = 0;
 	unsigned long start_time = jiffies;
 
 	DBG_871X_LEVEL(_drv_always_, " suspend start\n");
@@ -1196,7 +1195,7 @@ int rtw_suspend_common(struct adapter *padapter)
 
 exit:
 
-	return ret;
+	return 0;
 }
 
 static int rtw_resume_process_normal(struct adapter *padapter)
Signature · 1 line
2.25.1

If this function can only ever return 0, why is it returning anything at all? Please fix it up to not do that.

thanks,

greg k-h

#2 lore raw
Quoted 40 lines · Greg KH
Quoted 35 lines · Saurav Girepunje

Fix the following coccicheck warning:

drivers/staging/rtl8723bs/os_dep/os_intfs.c:1156:5-8:
Unneeded variable: "ret". Return "0" on line 1199

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 1f34cb2e367c..920ec25c9a4f 100644
@@ -1153,7 +1153,6 @@ int rtw_suspend_common(struct adapter *padapter)
 	struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	int ret = 0;
 	unsigned long start_time = jiffies;
 
 	DBG_871X_LEVEL(_drv_always_, " suspend start\n");
@@ -1196,7 +1195,7 @@ int rtw_suspend_common(struct adapter *padapter)
 
 exit:
 
-	return ret;
+	return 0;
 }
 
 static int rtw_resume_process_normal(struct adapter *padapter)
Signature · 1 line
2.25.1

If this function can only ever return 0, why is it returning anything at all? Please fix it up to not do that.

Quoted 3 lines

thanks,

greg k-h

Yes,this function always return 0. Function return type could be change to void. I will send another patch.