lkml.org 
[lkml]   [2021]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: rtl8188eu: replace goto with direct return
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.

\
 
 \ /
  Last update: 2021-04-05 00:26    [W:1.022 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site