All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: Change the return type
@ 2021-04-28 17:55 Saurav Girepunje
  2021-04-29 22:27 ` Bryan Brattlof
  0 siblings, 1 reply; 3+ messages in thread
From: Saurav Girepunje @ 2021-04-28 17:55 UTC (permalink / raw)
  To: gregkh, marcocesati, fabioaiuto83, dan.carpenter,
	saurav.girepunje, john.oldman, ross.schm.dev, insafonov, hello,
	hdegoede, linux-staging, linux-kernel
  Cc: 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.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
 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(-)

diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h
index 48c90f00cc2e..111e0179712a 100644
--- a/drivers/staging/rtl8723bs/include/osdep_intf.h
+++ b/drivers/staging/rtl8723bs/include/osdep_intf.h
@@ -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);
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 1f34cb2e367c..724909078d80 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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)
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index a9a9631dd23c..84c16925c4f5 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -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


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

* Re: [PATCH] staging: rtl8723bs: Change the return type
  2021-04-28 17:55 [PATCH] staging: rtl8723bs: Change the return type Saurav Girepunje
@ 2021-04-29 22:27 ` Bryan Brattlof
  2021-05-02 16:09   ` SAURAV GIREPUNJE
  0 siblings, 1 reply; 3+ messages in thread
From: Bryan Brattlof @ 2021-04-29 22:27 UTC (permalink / raw)
  To: Saurav Girepunje
  Cc: gregkh, marcocesati, fabioaiuto83, dan.carpenter, john.oldman,
	ross.schm.dev, insafonov, hdegoede, linux-staging, linux-kernel,
	saurav.girepunje

On Wed, Apr 28, 2021 at 11:25:20PM +0530, Saurav Girepunje wrote:
>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.
>
>Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>---
> 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(-)
>
>diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h
>index 48c90f00cc2e..111e0179712a 100644
>--- a/drivers/staging/rtl8723bs/include/osdep_intf.h
>+++ b/drivers/staging/rtl8723bs/include/osdep_intf.h
>@@ -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);
>diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
>index 1f34cb2e367c..724909078d80 100644
>--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
>+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
>@@ -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;
> }
>

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
>
> static int rtw_resume_process_normal(struct adapter *padapter)
>diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>index a9a9631dd23c..84c16925c4f5 100644
>--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
>@@ -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
>


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

* Re: [PATCH] staging: rtl8723bs: Change the return type
  2021-04-29 22:27 ` Bryan Brattlof
@ 2021-05-02 16:09   ` SAURAV GIREPUNJE
  0 siblings, 0 replies; 3+ messages in thread
From: SAURAV GIREPUNJE @ 2021-05-02 16:09 UTC (permalink / raw)
  To: Bryan Brattlof
  Cc: gregkh, marcocesati, fabioaiuto83, dan.carpenter, john.oldman,
	ross.schm.dev, insafonov, hdegoede, linux-staging, linux-kernel,
	saurav.girepunje

On Thu, Apr 29, 2021 at 10:27:33PM +0000, Bryan Brattlof wrote:
> On Wed, Apr 28, 2021 at 11:25:20PM +0530, Saurav Girepunje wrote:
> >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.
> >
> >Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> >---
> > 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(-)
> >
> >diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h
> >index 48c90f00cc2e..111e0179712a 100644
> >--- a/drivers/staging/rtl8723bs/include/osdep_intf.h
> >+++ b/drivers/staging/rtl8723bs/include/osdep_intf.h
> >@@ -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);
> >diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> >index 1f34cb2e367c..724909078d80 100644
> >--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> >+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> >@@ -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;
> > }
> >
>
> 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
> >
> > static int rtw_resume_process_normal(struct adapter *padapter)
> >diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> >index a9a9631dd23c..84c16925c4f5 100644
> >--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> >+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> >@@ -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
> >
>
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

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

end of thread, other threads:[~2021-05-02 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 17:55 [PATCH] staging: rtl8723bs: Change the return type Saurav Girepunje
2021-04-29 22:27 ` Bryan Brattlof
2021-05-02 16:09   ` SAURAV GIREPUNJE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.