Skip to contentSkip to conversation

ceph: fix warning PTR_ERR_OR_ZERO can be used

PATCH Applied Hariprasad Kelam 2 participants 2 messages May 25, 2019 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: fix warning PTR_ERR_OR_ZERO can be used

change1: fix below warning reported by coccicheck

/fs/ceph/export.c:371:33-39: WARNING: PTR_ERR_OR_ZERO can be used

change2: typecasted PTR_ERR_OR_ZERO to long as dout expecting long

---
 fs/ceph/export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/export.c +1 -1
index d3ef7ee42..15ff1b0 100644
@@ -368,7 +368,7 @@ static struct dentry *ceph_get_parent(struct dentry *child)
 	}
 out:
 	dout("get_parent %p ino %llx.%llx err=%ld\n",
-	     child, ceph_vinop(inode), (IS_ERR(dn) ? PTR_ERR(dn) : 0));
+	     child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
 	return dn;
 }
 
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 17 lines · Hariprasad Kelam

change1: fix below warning reported by coccicheck

/fs/ceph/export.c:371:33-39: WARNING: PTR_ERR_OR_ZERO can be used

change2: typecasted PTR_ERR_OR_ZERO to long as dout expecting long

---
  fs/ceph/export.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/export.c +0 -0
index d3ef7ee42..15ff1b0 100644

fs/ceph/export.c static struct dentry *ceph_get_parent(struct dentry *child) · line 374

Quoted 8 lines
fs/ceph/export.c +1 -1
@@ -368,7 +368,7 @@ static struct dentry *ceph_get_parent(struct dentry *child)
  	}
  out:
  	dout("get_parent %p ino %llx.%llx err=%ld\n",
-	     child, ceph_vinop(inode), (IS_ERR(dn) ? PTR_ERR(dn) : 0));
+	     child, ceph_vinop(inode), (long)PTR_ERR_OR_ZERO(dn));
  	return dn;
  }
 

Applied.

Thanks
Yan, Zheng