Skip to contentSkip to conversation

staging: lustre: remove else after return statement

PATCH In review Santha Meena Ramamoorthy 3 participants 3 messages Feb 24, 2018 – Feb 26, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: remove else after return statement

Remove else after a return statement as it is not useful. Issue found using checkpatch.

---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +5 -6
index 9e96a8e..93707e5 100644
@@ -1193,13 +1193,12 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md)
 			lmv_free_memmd(lli->lli_lsm_md);
 			lli->lli_lsm_md = NULL;
 			return 0;
-		} else {
-			/*
-			 * The lustre_md from req does not include stripeEA,
-			 * see ll_md_setattr
-			 */
-			return 0;
 		}
+		/*
+		 * The lustre_md from req does not include stripeEA,
+		 * see ll_md_setattr
+		 */
+		return 0;
 	}
 
 	/* set the directory layout */
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Santha Meena Ramamoorthy

Remove else after a return statement as it is not useful. Issue found using checkpatch.

I have the impression that the else branch is there to be parallel to the then branch, and then the return is pushed into the branch because an else branch with just a comment would look silly.

But Greg or the maintainers can decide is the patch should be taken.

julia

Quoted 39 lines
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +5 -7
index 9e96a8e..93707e5 100644
@@ -1193,13 +1193,12 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md)
 			lmv_free_memmd(lli->lli_lsm_md);
 			lli->lli_lsm_md = NULL;
 			return 0;
-		} else {
-			/*
-			 * The lustre_md from req does not include stripeEA,
-			 * see ll_md_setattr
-			 */
-			return 0;
 		}
+		/*
+		 * The lustre_md from req does not include stripeEA,
+		 * see ll_md_setattr
+		 */
+		return 0;
 	}
 
 	/* set the directory layout */
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1519513659-12304-1-git-send-email-santhameena13%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

maintainer
#2 lore raw
Quoted 10 lines · Julia Lawall
Quoted 2 lines · Santha Meena Ramamoorthy

Remove else after a return statement as it is not useful. Issue found using checkpatch.

I have the impression that the else branch is there to be parallel to the then branch, and then the return is pushed into the branch because an else branch with just a comment would look silly.

Exactly, I'd recommend to just leave this code as-is for now.

thanks,

greg k-h