* [PATCH] staging: rtl8723bs: os_dep: remove unneeded variable ret
@ 2021-04-18 16:48 Saurav Girepunje
2021-04-22 8:41 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Saurav Girepunje @ 2021-04-18 16:48 UTC (permalink / raw
To: gregkh, fabioaiuto83, john.oldman, ross.schm.dev, marcocesati,
insafonov, linux-staging, linux-kernel
Cc: 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
Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
---
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 1f34cb2e367c..920ec25c9a4f 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8723bs: os_dep: remove unneeded variable ret
2021-04-18 16:48 [PATCH] staging: rtl8723bs: os_dep: remove unneeded variable ret Saurav Girepunje
@ 2021-04-22 8:41 ` Greg KH
2021-04-27 19:11 ` SAURAV GIREPUNJE
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-04-22 8:41 UTC (permalink / raw
To: Saurav Girepunje
Cc: fabioaiuto83, john.oldman, ross.schm.dev, marcocesati, insafonov,
linux-staging, linux-kernel, saurav.girepunje
On Sun, Apr 18, 2021 at 10:18:13PM +0530, Saurav Girepunje wrote:
> Fix the following coccicheck warning:
>
> drivers/staging/rtl8723bs/os_dep/os_intfs.c:1156:5-8:
> Unneeded variable: "ret". Return "0" on line 1199
>
> Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
> ---
> drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 1f34cb2e367c..920ec25c9a4f 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -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)
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8723bs: os_dep: remove unneeded variable ret
2021-04-22 8:41 ` Greg KH
@ 2021-04-27 19:11 ` SAURAV GIREPUNJE
0 siblings, 0 replies; 3+ messages in thread
From: SAURAV GIREPUNJE @ 2021-04-27 19:11 UTC (permalink / raw
To: Greg KH
Cc: fabioaiuto83, john.oldman, ross.schm.dev, marcocesati, insafonov,
linux-staging, linux-kernel, saurav.girepunje
On Thu, Apr 22, 2021 at 10:41:07AM +0200, Greg KH wrote:
> On Sun, Apr 18, 2021 at 10:18:13PM +0530, Saurav Girepunje wrote:
> > Fix the following coccicheck warning:
> >
> > drivers/staging/rtl8723bs/os_dep/os_intfs.c:1156:5-8:
> > Unneeded variable: "ret". Return "0" on line 1199
> >
> > Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
> > ---
> > drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > index 1f34cb2e367c..920ec25c9a4f 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > @@ -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)
> > --
> > 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
Yes,this function always return 0. Function return type could be change
to void. I will send another patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-27 19:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-18 16:48 [PATCH] staging: rtl8723bs: os_dep: remove unneeded variable ret Saurav Girepunje
2021-04-22 8:41 ` Greg KH
2021-04-27 19:11 ` 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.