diff mbox

[DO,NOT,MERGE] ceph: fix ptr_ret.cocci warnings

Message ID 20180127030640.GA16408@lkp-g5 (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu Jan. 27, 2018, 3:06 a.m. UTC
From: Fengguang Wu <fengguang.wu@intel.com>

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


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 961bfcf78c8f ("[DO NOT MERGE] ceph: snapshot nfs re-export")
CC: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 export.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -354,7 +354,7 @@  static struct dentry *ceph_get_parent(st
 	}
 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), PTR_ERR_OR_ZERO(dn));
 	return dn;
 }