Skip to contentSkip to conversation

Staging: lustre: Use x instead of x != NULL.

PATCH In review Sandhya Bankar 2 participants 3 messages Sep 18, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: Use x instead of x != NULL.

This patch was found by checkpatch.

---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -1
index 1ff788e..b078959 100644
@@ -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))
Signature · 1 line
1.7.1
#1 lore raw
Quoted 12 lines · Sandhya Bankar

This patch was found by checkpatch.

---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -0
index 1ff788e..b078959 100644

drivers/staging/lustre/lustre/llite/llite_lib.c int ll_update_inode(struct inode *inode, struct lustre_md *md) · line 1704

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

Quoted 13 lines
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -1
 	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 [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/20160918182821.GA4646%40sandhya.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 22 lines · Julia Lawall

Review

Quoted 8 lines · Sandhya Bankar

This patch was found by checkpatch.

Signed-off-by Sandhya Bankar <[email protected] <javascript:>>

---

 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +- 
 1 files changed, 1 insertions(+), 1 deletions(-) 
(quoted diff) +0 -0

b/drivers/staging/lustre/lustre/llite/llite_lib.c

drivers/staging/lustre/lustre/llite/llite_lib.c int ll_update_inode(struct inode *inode, struct

Quoted 4 lines

index 1ff788e..b078959 100644

drivers/staging/lustre/lustre/llite/llite_lib.c +0 -0
@@ -1701,7 +1701,7 @@ int ll_update_inode(struct inode *inode, struct 

lustre_md *md)

Quoted 3 lines
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -0
         struct lov_stripe_md *lsm = md->lsm; 
         struct ll_sb_info *sbi = ll_i2sbi(inode); 
 
Quoted 9 lines

drivers/staging/lustre/lustre/llite/llite_lib.c int ll_update_inode(struct inode *inode, struct · line 1704

Quoted 1 line
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -1
-        LASSERT((lsm != NULL) == ((body->mbo_valid & OBD_MD_FLEASIZE) 

!= 0));

drivers/staging/lustre/lustre/llite/llite_lib.c int ll_update_inode(struct inode *inode, struct lustre_md *md) · line 1704

Quoted 1 line
drivers/staging/lustre/lustre/llite/llite_lib.c +1 -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.

Quoted 20 lines
Quoted 9 lines
drivers/staging/lustre/lustre/llite/llite_lib.c +0 -0
         if (lsm) { 
                 if (!lli->lli_has_smd && 
                     !(sbi->ll_flags & LL_SBI_LAYOUT_LOCK)) 
Signature · 4 lines
1.7.1 

-- 
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20160918182821.GA4646%40sandhya.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.