From: Joe Perches <joe@perches.com>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>,
Marcin Rokicki <marcin.rokicki@tieto.com>,
ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] ath10k: Remove return statement from a void function
Date: Thu, 23 Feb 2017 04:54:30 -0800 [thread overview]
Message-ID: <1487854470.14159.24.camel@perches.com> (raw)
In-Reply-To: <b7ac6892-4cbd-bd60-382f-5c51e9ae588a@broadcom.com>
On Wed, 2017-02-22 at 20:54 +0100, Arend Van Spriel wrote:
>
> On 21-2-2017 11:28, Marcin Rokicki wrote:
> > The empty 'return;' statement in a void function should be
> > used to return from somewhere else than the end.
> >
> > Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> > ---
> >
> > Changes for v2
> > -remove only return statement instead of empty err label
> > which can be used in the future
> >
> > ---
> > drivers/net/wireless/ath/ath10k/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> > index 59729aa..a22d3c9 100644
> > --- a/drivers/net/wireless/ath/ath10k/core.c
> > +++ b/drivers/net/wireless/ath/ath10k/core.c
> > @@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
> > /* TODO: It's probably a good idea to release device from the driver
> > * but calling device_release_driver() here will cause a deadlock.
> > */
> > - return;
> > + ;
>
> Not exactly what I meant. Just drop the whole line include semicolon.
gcc doesn't support a goto label without a
statement immediately before the end-of-function.
ie:
void foo(void)
{
goto err;
err:
}
fails to compile.
prev parent reply other threads:[~2017-02-23 12:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 10:28 [PATCH v2] ath10k: Remove return statement from a void function Marcin Rokicki
2017-02-22 19:54 ` Arend Van Spriel
2017-02-23 12:54 ` Joe Perches [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=1487854470.14159.24.camel@perches.com \
--to=joe@perches.com \
--cc=arend.vanspriel@broadcom.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=marcin.rokicki@tieto.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 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).