Skip to contentSkip to conversation

Staging: lustre: lustre: fid: Remove unnecessary else after return

PATCH Superseded aybuke ozdemir 2 participants 2 messages Feb 20, 2015 – Feb 26, 2015 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: lustre: lustre: fid: Remove unnecessary else after return

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

---
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(-)
drivers/staging/lustre/lustre/fid/fid_request.c +2 -2
index 063441a..a3a300e 100644
@@ -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;
 }
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 17 lines · 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

---
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(-)
drivers/staging/lustre/lustre/fid/fid_request.c +0 -0
index 063441a..a3a300e 100644

drivers/staging/lustre/lustre/fid/fid_request.c static int seq_client_alloc_seq(const struct lu_env *env, · line 203

Quoted 5 lines
drivers/staging/lustre/lustre/fid/fid_request.c +1 -1
@@ -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.

drivers/staging/lustre/lustre/fid/fid_request.c static int seq_client_alloc_seq(const struct lu_env *env, · line 206

Quoted 3 lines
drivers/staging/lustre/lustre/fid/fid_request.c +0 -0
 		} else {
 			CDEBUG(D_INFO, "%s: New range - "DRANGE"\n",
 			       seq->lcs_name, PRANGE(&seq->lcs_space));

thanks,

greg k-h