From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965330AbbLOPCk (ORCPT ); Tue, 15 Dec 2015 10:02:40 -0500 Received: from smtprelay0097.hostedemail.com ([216.40.44.97]:38606 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965234AbbLOPCj (ORCPT ); Tue, 15 Dec 2015 10:02:39 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:3873:3874:4321:4361:5007:6261:7576:10004:10400:10848:10967:11232:11658:11914:12043:12517:12519:12679:12740:13069:13161:13229:13255:13311:13357:14096:14097:14659:21080:30012:30054:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: leaf33_6d83e18687952 X-Filterd-Recvd-Size: 2632 Message-ID: <1450191751.3551.14.camel@perches.com> Subject: Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions From: Joe Perches To: Dan Carpenter Cc: SF Markus Elfring , Andreas Dilger , Greg Kroah-Hartman , Oleg Drokin , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall Date: Tue, 15 Dec 2015 07:02:31 -0800 In-Reply-To: <20151215144133.GC5284@mwanda> References: <566ABCD9.1060404@users.sourceforge.net> <566D7733.1030102@users.sourceforge.net> <566D7830.9060000@users.sourceforge.net> <1450189676.3551.1.camel@perches.com> <20151215144133.GC5284@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.2-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-12-15 at 17:41 +0300, Dan Carpenter wrote: > On Tue, Dec 15, 2015 at 06:27:56AM -0800, Joe Perches wrote: > > On Sun, 2015-12-13 at 14:52 +0100, SF Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Sun, 13 Dec 2015 09:30:47 +0100 > > > > > > Six goto statements referred to a source code position directly behind them. > > > Thus omit such unnecessary jumps. > > > > I suggest you leave a blank line instead > > of deleting the goto. > > > > What is the point of the little bunny hop? > > regards, > dan carpenter > -ENOPARSE little bunny hop (though I could have said "just leave a blank line) I think that code blocks are more obvious to read. This is the original code: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); if (result) goto label; label: go on... He proposes: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on... I don't find the test->goto label; label: use offensive, but if he does, I think keeping a blank line in place of the test->goto might be better. result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on... From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Tue, 15 Dec 2015 15:02:31 +0000 Subject: Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions Message-Id: <1450191751.3551.14.camel@perches.com> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <566D7733.1030102@users.sourceforge.net> <566D7830.9060000@users.sourceforge.net> <1450189676.3551.1.camel@perches.com> <20151215144133.GC5284@mwanda> In-Reply-To: <20151215144133.GC5284@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: SF Markus Elfring , Andreas Dilger , Greg Kroah-Hartman , Oleg Drokin , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall On Tue, 2015-12-15 at 17:41 +0300, Dan Carpenter wrote: > On Tue, Dec 15, 2015 at 06:27:56AM -0800, Joe Perches wrote: > > On Sun, 2015-12-13 at 14:52 +0100, SF Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Sun, 13 Dec 2015 09:30:47 +0100 > > > > > > Six goto statements referred to a source code position directly behind them. > > > Thus omit such unnecessary jumps. > > > > I suggest you leave a blank line instead > > of deleting the goto. > > > > What is the point of the little bunny hop? > > regards, > dan carpenter > -ENOPARSE little bunny hop (though I could have said "just leave a blank line) I think that code blocks are more obvious to read. This is the original code: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); if (result) goto label; label: go on... He proposes: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on... I don't find the test->goto label; label: use offensive, but if he does, I think keeping a blank line in place of the test->goto might be better. result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on... From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Tue, 15 Dec 2015 07:02:31 -0800 Subject: [lustre-devel] [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions In-Reply-To: <20151215144133.GC5284@mwanda> References: <566ABCD9.1060404@users.sourceforge.net> <566D7733.1030102@users.sourceforge.net> <566D7830.9060000@users.sourceforge.net> <1450189676.3551.1.camel@perches.com> <20151215144133.GC5284@mwanda> Message-ID: <1450191751.3551.14.camel@perches.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lustre-devel@lists.lustre.org On Tue, 2015-12-15 at 17:41 +0300, Dan Carpenter wrote: > On Tue, Dec 15, 2015 at 06:27:56AM -0800, Joe Perches wrote: > > On Sun, 2015-12-13 at 14:52 +0100, SF Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Sun, 13 Dec 2015 09:30:47 +0100 > > > > > > Six goto statements referred to a source code position directly behind them. > > > Thus omit such unnecessary jumps. > > > > I suggest you leave a blank line instead > > of deleting the goto. > > > > What is the point of the little bunny hop? > > regards, > dan carpenter > -ENOPARSE little bunny hop (though I could have said "just leave a blank line) I think that code blocks are more obvious to read. This is the original code: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); if (result) goto label; label: go on... He proposes: result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on... I don't find the test->goto label; label: use offensive, but if he does, I think keeping a blank line in place of the test->goto might be better. result = foo(); if (result) goto label; result = bar(); if (result) goto label; result = baz(); label: go on...