From patchwork Thu Feb 13 22:28:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 320203 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C77BE2C009F for ; Fri, 14 Feb 2014 09:29:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbaBMW2r (ORCPT ); Thu, 13 Feb 2014 17:28:47 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:40144 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482AbaBMW2a (ORCPT ); Thu, 13 Feb 2014 17:28:30 -0500 X-IronPort-AV: E=Sophos;i="4.95,841,1384297200"; d="scan'208";a="58384845" Received: from 198.67.28.109.rev.sfr.net (HELO hadrien) ([109.28.67.198]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Feb 2014 23:28:28 +0100 Date: Thu, 13 Feb 2014 23:28:27 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Dave Jones cc: Julia Lawall , Joe Perches , Stephen Hemminger , David Miller , netdev@vger.kernel.org Subject: Re: [PATCH net-next] net: remove unnecessary return's In-Reply-To: <20140213220021.GA1174@redhat.com> Message-ID: References: <20140212205122.5783660e@nehalam.linuxnetplumber.net> <1392273125.2214.25.camel@joe-AO722> <20140213220021.GA1174@redhat.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 13 Feb 2014, Dave Jones wrote: > On Thu, Feb 13, 2014 at 10:55:23PM +0100, Julia Lawall wrote: > > > The patch below converts label: return; } to label: ; }. I have only > > scanned through the patches, not patched the code and looked at the > > results, so I am not sure that it is completely correct. On the other > > hand, I'm also not sure that label: ; } is better than label: return; }, > > either. If people think it is, then I can cheack the results in more > > detail. > > Why not delete the label, and just replace the goto with a return if > the label is at the end of the function ? Here is an example. Perhaps the uniformity of the if ... goto pattern is valuable, though? julia --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -u -p a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c --- a/drivers/mfd/ab3100-core.c +++ b/drivers/mfd/ab3100-core.c @@ -586,7 +586,7 @@ static void ab3100_setup_debugfs(struct ab3100_dir = debugfs_create_dir("ab3100", NULL); if (!ab3100_dir) - goto exit_no_debugfs; + return; ab3100_reg_file = debugfs_create_file("registers", S_IRUGO, ab3100_dir, ab3100, @@ -623,7 +623,6 @@ static void ab3100_setup_debugfs(struct debugfs_remove(ab3100_reg_file); exit_destroy_dir: debugfs_remove(ab3100_dir); - exit_no_debugfs: return; } static inline void ab3100_remove_debugfs(void)