[PATCH v2 1/4] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-21 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 21 Dec 2015 18:15:45 +0100 Six goto statements referred to a source code position directly behind them. Thus omit such unnecessary jumps. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/l

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
On Tue, 2015-12-15 at 19:49 +0100, SF Markus Elfring wrote: > > I think there should _not_ be a hardened rule. > I guess that it can become hard to achieve consensus on a precise rule. Consensus isn't unanimity. > I imagine that your feedback > can cause further software development troubles if t

Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Dan Carpenter
On Tue, Dec 15, 2015 at 07:02:31AM -0800, Joe Perches wrote: > This is the original code: > > result = foo(); > if (result) > goto label; > > result = bar(); > if (result) > goto label; > > result = baz(); > if (result) >

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread SF Markus Elfring
> I think there should _not_ be a hardened rule. I guess that it can become hard to achieve consensus on a precise rule. > Style is just a guide. Generally nice … > Do what you think appropriate. I'm sorry for my evolving understanding. - But I imagine that your feedback can cause further

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
On Tue, 2015-12-15 at 19:26 +0100, SF Markus Elfring wrote: > > rc = mdc_queue_wait(req); > > goto out; > > out: > > ptlrpc_req_finished(req); > > return rc; > > } > > - > > > > I think if the last goto out; is to be removed, > > then it should be replaced by a

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread SF Markus Elfring
> rc = mdc_queue_wait(req); > goto out; > out: > ptlrpc_req_finished(req); > return rc; > } > - > > I think if the last goto out; is to be removed, > then it should be replaced by a blank line. > > It separates the last operation block from the return.

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
On Tue, 2015-12-15 at 19:02 +0100, SF Markus Elfring wrote: > > This is the original code: > Really …? > > result = baz(); > > if (result) > > goto label; > > > > label: > > go on... > > I do not see such a source code structure > at the six places I propose to clean-up. >

Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
On Tue, 2015-12-15 at 20:48 +0300, Dan Carpenter wrote: > On Tue, Dec 15, 2015 at 07:02:31AM -0800, Joe Perches wrote: > > This is the original code: > > > > result = foo(); > > if (result) > > goto label; > > > > result = bar(); > > if (result) > > goto la

Re: staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread SF Markus Elfring
> This is the original code: Really …? > result = baz(); > if (result) > goto label; > > label: > go on... I do not see such a source code structure at the six places I propose to clean-up. > I don't find the test->goto label; label: use offensive, > but if he doe

Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
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

Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Dan Carpenter
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 unn

Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-15 Thread Joe Perches
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

[PATCH 1/7] staging: lustre: Delete unnecessary goto statements in six functions

2015-12-13 Thread SF Markus Elfring
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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/l