linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8188eu: replace goto with direct return
@ 2021-04-04  5:40 Deborah Brouwer
  2021-04-04  9:49 ` [Outreachy kernel] " Julia Lawall
  2021-04-04  9:54 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Deborah Brouwer @ 2021-04-04  5:40 UTC (permalink / raw)
  To: Larry.Finger, gregkh, straube.linux, unixbhaskar
  Cc: linux-staging, linux-kernel, outreachy-kernel, Deborah Brouwer

To conform with Linux kernel coding style, replace goto statement that
does no cleanup with a direct return.  To preserve meaning, copy comments
from the original goto statement to the return statement.  Identified by
the checkpatch warning: WARNING: void function return statements are not
generally useful.

Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
index 391c59490718..d21f21857c20 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
@@ -139,7 +139,9 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
 	hw_init_completed = Adapter->hw_init_completed;
 
 	if (!hw_init_completed)
-		goto skip_dm;
+		/*  Check GPIO to determine current RF on/off and Pbc status. */
+		/*  Check Hardware Radio ON/OFF or not */
+		return;
 
 	/* ODM */
 	pmlmepriv = &Adapter->mlmepriv;
@@ -156,10 +158,8 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
 
 	Adapter->HalData->odmpriv.bLinked = bLinked;
 	ODM_DMWatchdog(&Adapter->HalData->odmpriv);
-skip_dm:
 	/*  Check GPIO to determine current RF on/off and Pbc status. */
 	/*  Check Hardware Radio ON/OFF or not */
-	return;
 }
 
 void rtw_hal_dm_init(struct adapter *Adapter)
-- 
2.17.1


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

* Re: [Outreachy kernel] [PATCH] staging: rtl8188eu: replace goto with direct return
  2021-04-04  5:40 [PATCH] staging: rtl8188eu: replace goto with direct return Deborah Brouwer
@ 2021-04-04  9:49 ` Julia Lawall
  2021-04-04  9:54 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2021-04-04  9:49 UTC (permalink / raw)
  To: Deborah Brouwer
  Cc: Larry.Finger, gregkh, straube.linux, unixbhaskar, linux-staging,
	linux-kernel, outreachy-kernel



On Sat, 3 Apr 2021, Deborah Brouwer wrote:

> To conform with Linux kernel coding style, replace goto statement that
> does no cleanup with a direct return.  To preserve meaning, copy comments
> from the original goto statement to the return statement.  Identified by
> the checkpatch warning: WARNING: void function return statements are not
> generally useful.

Maybe the comments are meant as TODO items?

julia

>
> Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> index 391c59490718..d21f21857c20 100644
> --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> @@ -139,7 +139,9 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
>  	hw_init_completed = Adapter->hw_init_completed;
>
>  	if (!hw_init_completed)
> -		goto skip_dm;
> +		/*  Check GPIO to determine current RF on/off and Pbc status. */
> +		/*  Check Hardware Radio ON/OFF or not */
> +		return;
>
>  	/* ODM */
>  	pmlmepriv = &Adapter->mlmepriv;
> @@ -156,10 +158,8 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
>
>  	Adapter->HalData->odmpriv.bLinked = bLinked;
>  	ODM_DMWatchdog(&Adapter->HalData->odmpriv);
> -skip_dm:
>  	/*  Check GPIO to determine current RF on/off and Pbc status. */
>  	/*  Check Hardware Radio ON/OFF or not */
> -	return;
>  }
>
>  void rtw_hal_dm_init(struct adapter *Adapter)
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20210404054008.23525-1-deborahbrouwer3563%40gmail.com.
>

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

* Re: [PATCH] staging: rtl8188eu: replace goto with direct return
  2021-04-04  5:40 [PATCH] staging: rtl8188eu: replace goto with direct return Deborah Brouwer
  2021-04-04  9:49 ` [Outreachy kernel] " Julia Lawall
@ 2021-04-04  9:54 ` Greg KH
  2021-04-04 22:25   ` Deborah Brouwer
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-04-04  9:54 UTC (permalink / raw)
  To: Deborah Brouwer
  Cc: Larry.Finger, straube.linux, unixbhaskar, linux-staging,
	linux-kernel, outreachy-kernel

On Sat, Apr 03, 2021 at 10:40:08PM -0700, Deborah Brouwer wrote:
> To conform with Linux kernel coding style, replace goto statement that
> does no cleanup with a direct return.  To preserve meaning, copy comments
> from the original goto statement to the return statement.  Identified by
> the checkpatch warning: WARNING: void function return statements are not
> generally useful.
> 
> Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> index 391c59490718..d21f21857c20 100644
> --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> @@ -139,7 +139,9 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
>  	hw_init_completed = Adapter->hw_init_completed;
>  
>  	if (!hw_init_completed)
> -		goto skip_dm;
> +		/*  Check GPIO to determine current RF on/off and Pbc status. */
> +		/*  Check Hardware Radio ON/OFF or not */
> +		return;

It does not make sense to have the comments in two places here.  The
original code is just fine, there's nothing wrong with the goto
statement here.

thanks,

greg k-h

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

* Re: [PATCH] staging: rtl8188eu: replace goto with direct return
  2021-04-04  9:54 ` Greg KH
@ 2021-04-04 22:25   ` Deborah Brouwer
  0 siblings, 0 replies; 4+ messages in thread
From: Deborah Brouwer @ 2021-04-04 22:25 UTC (permalink / raw)
  To: Greg KH
  Cc: Larry.Finger, straube.linux, unixbhaskar, linux-staging,
	linux-kernel, outreachy-kernel

On Sun, Apr 04, 2021 at 11:54:40AM +0200, Greg KH wrote:
> On Sat, Apr 03, 2021 at 10:40:08PM -0700, Deborah Brouwer wrote:
> > To conform with Linux kernel coding style, replace goto statement that
> > does no cleanup with a direct return.  To preserve meaning, copy comments
> > from the original goto statement to the return statement.  Identified by
> > the checkpatch warning: WARNING: void function return statements are not
> > generally useful.
> > 
> > Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com>
> > ---
> >  drivers/staging/rtl8188eu/hal/rtl8188e_dm.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> > index 391c59490718..d21f21857c20 100644
> > --- a/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> > +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
> > @@ -139,7 +139,9 @@ void rtw_hal_dm_watchdog(struct adapter *Adapter)
> >  	hw_init_completed = Adapter->hw_init_completed;
> >  
> >  	if (!hw_init_completed)
> > -		goto skip_dm;
> > +		/*  Check GPIO to determine current RF on/off and Pbc status. */
> > +		/*  Check Hardware Radio ON/OFF or not */
> > +		return;
> 
> It does not make sense to have the comments in two places here.  The
> original code is just fine, there's nothing wrong with the goto
> statement here.
> 
> thanks,
> 
> greg k-h

Ok, thanks for this feedback.

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

end of thread, other threads:[~2021-04-04 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-04  5:40 [PATCH] staging: rtl8188eu: replace goto with direct return Deborah Brouwer
2021-04-04  9:49 ` [Outreachy kernel] " Julia Lawall
2021-04-04  9:54 ` Greg KH
2021-04-04 22:25   ` Deborah Brouwer

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