Skip to contentSkip to conversation

staging: rtl8723bs: Change the return type

PATCH In review Saurav Girepunje 2 participants 3 messages Apr 28, 2021 – May 2, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: Change the return type

Remove the ret variable in rtw_suspend_common() and change the return type from int to void as rtw_suspend_common() always return zero unconditionally.

---
 drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +-
 drivers/staging/rtl8723bs/os_dep/os_intfs.c    | 5 ++---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c   | 4 +++-
 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/include/osdep_intf.h +1 -1
index 48c90f00cc2e..111e0179712a 100644
@@ -66,7 +66,7 @@ void rtw_ips_pwr_down(struct adapter *padapter);
 int rtw_drv_register_netdev(struct adapter *padapter);
 void rtw_ndev_destructor(struct net_device *ndev);
 
-int rtw_suspend_common(struct adapter *padapter);
+void rtw_suspend_common(struct adapter *padapter);
 int rtw_resume_common(struct adapter *padapter);
 
 int netdev_open(struct net_device *pnetdev);
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -3
index 1f34cb2e367c..724909078d80 100644
@@ -1146,14 +1146,13 @@ static void rtw_suspend_normal(struct adapter *padapter)
 		padapter->intf_deinit(adapter_to_dvobj(padapter));
 }
 
-int rtw_suspend_common(struct adapter *padapter)
+void rtw_suspend_common(struct adapter *padapter)
 {
 	struct dvobj_priv *psdpriv = padapter->dvobj;
 	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	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;
 }
 
 static int rtw_resume_process_normal(struct adapter *padapter)
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +3 -1
index a9a9631dd23c..84c16925c4f5 100644
@@ -452,7 +452,9 @@ static int rtw_sdio_suspend(struct device *dev)
 		return 0;
 	}
 
-	return rtw_suspend_common(padapter);
+	rtw_suspend_common(padapter);
+
+	return 0;
 }
 
 static int rtw_resume_process(struct adapter *padapter)
Signature · 1 line
2.25.1
#1 lore raw
Quoted 50 lines · Saurav Girepunje

Remove the ret variable in rtw_suspend_common() and change the return type from int to void as rtw_suspend_common() always return zero unconditionally.

---

drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +-
drivers/staging/rtl8723bs/os_dep/os_intfs.c    | 5 ++---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c   | 4 +++-
3 files changed, 6 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/include/osdep_intf.h +1 -1
index 48c90f00cc2e..111e0179712a 100644
@@ -66,7 +66,7 @@ void rtw_ips_pwr_down(struct adapter *padapter);
 int rtw_drv_register_netdev(struct adapter *padapter);
 void rtw_ndev_destructor(struct net_device *ndev);
 
-int rtw_suspend_common(struct adapter *padapter);
+void rtw_suspend_common(struct adapter *padapter);
 int rtw_resume_common(struct adapter *padapter);
 
 int netdev_open(struct net_device *pnetdev);
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 1f34cb2e367c..724909078d80 100644
@@ -1146,14 +1146,13 @@ static void rtw_suspend_normal(struct adapter *padapter)
 		padapter->intf_deinit(adapter_to_dvobj(padapter));
 }
 
-int rtw_suspend_common(struct adapter *padapter)
+void rtw_suspend_common(struct adapter *padapter)
 {
 	struct dvobj_priv *psdpriv = padapter->dvobj;
 	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	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:

drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -1
-	return ret;
+	return;
Quoted 2 lines

}

Hi Saurav

Now that this function doesn't return anything, we can also remove the exit: jump by replacing the goto exit on line 1175 with this return.

--
~Bryan

Quoted 20 lines

static int rtw_resume_process_normal(struct adapter *padapter)

drivers/staging/rtl8723bs/os_dep/sdio_intf.c +3 -2
index a9a9631dd23c..84c16925c4f5 100644
@@ -452,7 +452,9 @@ static int rtw_sdio_suspend(struct device *dev)
 		return 0;
 	}
 
-	return rtw_suspend_common(padapter);
+	rtw_suspend_common(padapter);
+
+	return 0;
 }
 
 static int rtw_resume_process(struct adapter *padapter)
--

2.25.1

#2 lore raw
Quoted 78 lines · Bryan Brattlof
Quoted 50 lines · Saurav Girepunje

Remove the ret variable in rtw_suspend_common() and change the return type from int to void as rtw_suspend_common() always return zero unconditionally.

---

drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +-
drivers/staging/rtl8723bs/os_dep/os_intfs.c    | 5 ++---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c   | 4 +++-
3 files changed, 6 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/include/osdep_intf.h +1 -1
index 48c90f00cc2e..111e0179712a 100644
@@ -66,7 +66,7 @@ void rtw_ips_pwr_down(struct adapter *padapter);
 int rtw_drv_register_netdev(struct adapter *padapter);
 void rtw_ndev_destructor(struct net_device *ndev);
 
-int rtw_suspend_common(struct adapter *padapter);
+void rtw_suspend_common(struct adapter *padapter);
 int rtw_resume_common(struct adapter *padapter);
 
 int netdev_open(struct net_device *pnetdev);
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -2
index 1f34cb2e367c..724909078d80 100644
@@ -1146,14 +1146,13 @@ static void rtw_suspend_normal(struct adapter *padapter)
 		padapter->intf_deinit(adapter_to_dvobj(padapter));
 }
 
-int rtw_suspend_common(struct adapter *padapter)
+void rtw_suspend_common(struct adapter *padapter)
 {
 	struct dvobj_priv *psdpriv = padapter->dvobj;
 	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	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:

drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -1
-	return ret;
+	return;
Quoted 2 lines

}

Hi Saurav

Now that this function doesn't return anything, we can also remove the exit: jump by replacing the goto exit on line 1175 with this return.

--
~Bryan

Quoted 16 lines

static int rtw_resume_process_normal(struct adapter *padapter)

drivers/staging/rtl8723bs/os_dep/sdio_intf.c +3 -1
index a9a9631dd23c..84c16925c4f5 100644
@@ -452,7 +452,9 @@ static int rtw_sdio_suspend(struct device *dev)
 		return 0;
 	}
 
-	return rtw_suspend_common(padapter);
+	rtw_suspend_common(padapter);
+
+	return 0;
 }
 
Quoted 5 lines
Quoted 4 lines
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +0 -1
 static int rtw_resume_process(struct adapter *padapter)
--

2.25.1

I think you are pointing to rtw_suspend_common function's goto statement. Yes, We can remove now. I will send a separate patch for removing goto statement.

~Saurav