All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: remove else after return statement
@ 2018-02-24 23:07 Santha Meena Ramamoorthy
  2018-02-25  8:30 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Santha Meena Ramamoorthy @ 2018-02-24 23:07 UTC (permalink / raw)
  To: gregkh
  Cc: oleg.drokin, andreas.dilger, jsimmons, outreachy-kernel,
	Santha Meena Ramamoorthy

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

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 9e96a8e..93707e5 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -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



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

* Re: [Outreachy kernel] [PATCH] staging: lustre: remove else after return statement
  2018-02-24 23:07 [PATCH] staging: lustre: remove else after return statement Santha Meena Ramamoorthy
@ 2018-02-25  8:30 ` Julia Lawall
  2018-02-26 14:43   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2018-02-25  8:30 UTC (permalink / raw)
  To: Santha Meena Ramamoorthy
  Cc: gregkh, oleg.drokin, andreas.dilger, jsimmons, outreachy-kernel



On Sat, 24 Feb 2018, Santha Meena Ramamoorthy wrote:

> 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


>
> Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
> ---
>  drivers/staging/lustre/lustre/llite/llite_lib.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
> index 9e96a8e..93707e5 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_lib.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>


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

* Re: [Outreachy kernel] [PATCH] staging: lustre: remove else after return statement
  2018-02-25  8:30 ` [Outreachy kernel] " Julia Lawall
@ 2018-02-26 14:43   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-02-26 14:43 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Santha Meena Ramamoorthy, oleg.drokin, andreas.dilger, jsimmons,
	outreachy-kernel

On Sun, Feb 25, 2018 at 09:30:40AM +0100, Julia Lawall wrote:
> 
> 
> On Sat, 24 Feb 2018, Santha Meena Ramamoorthy wrote:
> 
> > 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


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

end of thread, other threads:[~2018-02-26 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-24 23:07 [PATCH] staging: lustre: remove else after return statement Santha Meena Ramamoorthy
2018-02-25  8:30 ` [Outreachy kernel] " Julia Lawall
2018-02-26 14:43   ` 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.