All of lore.kernel.org
 help / color / mirror / Atom feed
From: SAURAV GIREPUNJE <saurav.girepunje@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, fabioaiuto83@gmail.com,
	hello@bryanbrattlof.com, hdegoede@redhat.com,
	saurav.girepunje@google.com, john.oldman@polehill.co.uk,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	saurav.girepunje@hotmail.com
Subject: Re: [PATCH] staging: rtl8723bs: os_dep: remove multiple return
Date: Wed, 28 Apr 2021 01:15:33 +0530	[thread overview]
Message-ID: <20210427194533.GC11046@user> (raw)
In-Reply-To: <20210420110609.GD1981@kadam>

On Tue, Apr 20, 2021 at 02:06:09PM +0300, Dan Carpenter wrote:
> On Sun, Apr 18, 2021 at 11:02:33PM +0530, Saurav Girepunje wrote:
> > on sdio_intf.c rtw_sdio_suspend call we have multiple
> > return which can replace by goto exit. As in all the places
> > return value is 0.
> > 
> > Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
> > ---
> >  drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> > index a9a9631dd23c..3e566cf97f6e 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> > @@ -445,14 +445,17 @@ static int rtw_sdio_suspend(struct device *dev)
> >  	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
> >  
> >  	if (padapter->bDriverStopped)
> > -		return 0;
> > +		goto exit;
> >  
> >  	if (pwrpriv->bInSuspend) {
> >  		pdbgpriv->dbg_suspend_error_cnt++;
> > -		return 0;
> > +		goto exit;
> >  	}
> >  
> > -	return rtw_suspend_common(padapter);
> > +	rtw_suspend_common(padapter);
> 
> Also it's weird that your previous patch made rtw_suspend_common()
> return zero unconditionally.  But now we're modifying the only caller to
> not check the return.  Just make rtw_suspend_common() void and change
> this to:
> 
> 	rtw_suspend_common(padapter);
> 
> 	return 0;
> 
> regards,
> dan carpenter
>

Sure, rtw_suspend_common always return 0. It should be void.
I will merge and resend the patch.

      reply	other threads:[~2021-04-27 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 17:32 [PATCH] staging: rtl8723bs: os_dep: remove multiple return Saurav Girepunje
2021-04-20 11:03 ` Dan Carpenter
2021-04-20 11:06 ` Dan Carpenter
2021-04-27 19:45   ` SAURAV GIREPUNJE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210427194533.GC11046@user \
    --to=saurav.girepunje@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hello@bryanbrattlof.com \
    --cc=john.oldman@polehill.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=saurav.girepunje@google.com \
    --cc=saurav.girepunje@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.