All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: lustre: Use x instead of x != NULL.
@ 2016-09-18 18:28 Sandhya Bankar
  2016-09-18 18:43 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Sandhya Bankar @ 2016-09-18 18:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: oleg.drokin, andreas.dilger, jsimmons, gregkh

This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 1ff788e..b078959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1701,7 +1701,7 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
 	struct lov_stripe_md *lsm = md->lsm;
 	struct ll_sb_info *sbi = ll_i2sbi(inode);
 
-	LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
+	LASSERT(lsm == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
 	if (lsm) {
 		if (!lli->lli_has_smd &&
 		    !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
-- 
1.7.1



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

* Re: [Outreachy kernel] [PATCH] Staging: lustre: Use x instead of x != NULL.
  2016-09-18 18:28 [PATCH] Staging: lustre: Use x instead of x != NULL Sandhya Bankar
@ 2016-09-18 18:43 ` Julia Lawall
  2016-09-18 19:02   ` Sandhya Bankar
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2016-09-18 18:43 UTC (permalink / raw)
  To: Sandhya Bankar
  Cc: outreachy-kernel, oleg.drokin, andreas.dilger, jsimmons, gregkh



On Sun, 18 Sep 2016, Sandhya Bankar wrote:

> This patch was found by checkpatch.
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
>  drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
> index 1ff788e..b078959 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_lib.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
> @@ -1701,7 +1701,7 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
>  	struct lov_stripe_md *lsm = md->lsm;
>  	struct ll_sb_info *sbi = ll_i2sbi(inode);
>
> -	LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));
> +	LASSERT(lsm == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0));

This is not correct.  I'll let you figure out why.  Think about the types
of the various expressions involved.

julia

>  	if (lsm) {
>  		if (!lli->lli_has_smd &&
>  		    !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK))
> --
> 1.7.1
>
> --
> 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/20160918182821.GA4646%40sandhya.
> 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: Use x instead of x != NULL.
  2016-09-18 18:43 ` [Outreachy kernel] " Julia Lawall
@ 2016-09-18 19:02   ` Sandhya Bankar
  0 siblings, 0 replies; 3+ messages in thread
From: Sandhya Bankar @ 2016-09-18 19:02 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: bankarsandhya512, oleg.drokin, andreas.dilger, jsimmons, gregkh


[-- Attachment #1.1: Type: text/plain, Size: 1908 bytes --]



On Monday, September 19, 2016 at 12:13:49 AM UTC+5:30, Julia Lawall wrote:
>
>
>
> On Sun, 18 Sep 2016, Sandhya Bankar wrote: 
>
> > This patch was found by checkpatch. 
> > 
> > Signed-off-by: Sandhya Bankar <bankarsa...@gmail.com <javascript:>> 
> > --- 
> >  drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +- 
> >  1 files changed, 1 insertions(+), 1 deletions(-) 
> > 
> > diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
> b/drivers/staging/lustre/lustre/llite/llite_lib.c 
> > index 1ff788e..b078959 100644 
> > --- a/drivers/staging/lustre/lustre/llite/llite_lib.c 
> > +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c 
> > @@ -1701,7 +1701,7 @@ int ll_update_inode(struct inode *inode, struct 
> lustre_md *md) 
> >          struct lov_stripe_md *lsm = md->lsm; 
> >          struct ll_sb_info *sbi = ll_i2sbi(inode); 
> > 
> > -        LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) 
> != 0)); 
> > +        LASSERT(lsm == ((body->mbo_valid & OBD_MD_FLEASIZE) != 0)); 
>
> This is not correct.  I'll let you figure out why.  Think about the types 
> of the various expressions involved. 
>
> julia 
>

Thanks ! I understood the mistake.
 

>
> >          if (lsm) { 
> >                  if (!lli->lli_has_smd && 
> >                      !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK)) 
> > -- 
> > 1.7.1 
> > 
> > -- 
> > 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-kern...@googlegroups.com <javascript:>. 
> > To post to this group, send email to outreach...@googlegroups.com 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20160918182821.GA4646%40sandhya. 
>
> > For more options, visit https://groups.google.com/d/optout. 
> > 
>

[-- Attachment #1.2: Type: text/html, Size: 3762 bytes --]

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

end of thread, other threads:[~2016-09-18 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 18:28 [PATCH] Staging: lustre: Use x instead of x != NULL Sandhya Bankar
2016-09-18 18:43 ` [Outreachy kernel] " Julia Lawall
2016-09-18 19:02   ` Sandhya Bankar

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.