ceph: fix warning PTR_ERR_OR_ZERO can be used
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Sat, 25 May 2019 09:15:59 +0000 (14:45 +0530)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2019 12:01:42 +0000 (14:01 +0200)
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

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/export.c

index d3ef7ee..15ff1b0 100644 (file)
@@ -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;
 }