From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay0137.hostedemail.com ([216.40.44.137] helo=smtprelay.hostedemail.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgsvH-0004IY-Uz for ath10k@lists.infradead.org; Thu, 23 Feb 2017 12:55:05 +0000 Message-ID: <1487854470.14159.24.camel@perches.com> Subject: Re: [PATCH v2] ath10k: Remove return statement from a void function From: Joe Perches Date: Thu, 23 Feb 2017 04:54:30 -0800 In-Reply-To: References: <1487672891-8584-1-git-send-email-marcin.rokicki@tieto.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Arend Van Spriel , Marcin Rokicki , ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org 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 > > --- > > > > 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. _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k