All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: lustre: lustre: fid: Remove unnecessary else after return
@ 2015-02-20 19:38 aybuke ozdemir
  2015-02-26 18:25 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: aybuke ozdemir @ 2015-02-20 19:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: aybuke ozdemir

This patch fixes "else is not generally useful after
a break or return" checkpatch.pl warning using goto statement in fid_request.c

Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com>
---
Changes since v1:
* removed the "else" block instead of goto statement was used and
a commit message has been corrected.
---
 drivers/staging/lustre/lustre/fid/fid_request.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
index 063441a..a3a300e 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -200,7 +200,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
 		if (rc) {
 			CERROR("%s: Can't allocate new meta-sequence, rc %d\n",
 			       seq->lcs_name, rc);
-			return rc;
+			goto out;
 		} else {
 			CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
 			       seq->lcs_name, PRANGE(&seq->lcs_space));
@@ -215,7 +215,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
 
 	CDEBUG(D_INFO, "%s: Allocated sequence [%#llx]\n", seq->lcs_name,
 	       *seqnr);
-
+out:
 	return rc;
 }
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] Staging: lustre: lustre: fid: Remove unnecessary else after return
  2015-02-20 19:38 [PATCH v2] Staging: lustre: lustre: fid: Remove unnecessary else after return aybuke ozdemir
@ 2015-02-26 18:25 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-02-26 18:25 UTC (permalink / raw)
  To: aybuke ozdemir; +Cc: outreachy-kernel

On Fri, Feb 20, 2015 at 09:38:59PM +0200, aybuke ozdemir wrote:
> This patch fixes "else is not generally useful after
> a break or return" checkpatch.pl warning using goto statement in fid_request.c
> 
> Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com>
> ---
> Changes since v1:
> * removed the "else" block instead of goto statement was used and
> a commit message has been corrected.
> ---
>  drivers/staging/lustre/lustre/fid/fid_request.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
> index 063441a..a3a300e 100644
> --- a/drivers/staging/lustre/lustre/fid/fid_request.c
> +++ b/drivers/staging/lustre/lustre/fid/fid_request.c
> @@ -200,7 +200,7 @@ static int seq_client_alloc_seq(const struct lu_env *env,
>  		if (rc) {
>  			CERROR("%s: Can't allocate new meta-sequence, rc %d\n",
>  			       seq->lcs_name, rc);
> -			return rc;
> +			goto out;

No need for this, just remove the else line below here instead.

>  		} else {
>  			CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
>  			       seq->lcs_name, PRANGE(&seq->lcs_space));

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-26 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-20 19:38 [PATCH v2] Staging: lustre: lustre: fid: Remove unnecessary else after return aybuke ozdemir
2015-02-26 18:25 ` [Outreachy kernel] " Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.