ceph: fix warning PTR_ERR_OR_ZERO can be used
diff mbox series

Message ID 20190525091559.GA14633@hari-Inspiron-1545
State New
Headers show
Series
  • ceph: fix warning PTR_ERR_OR_ZERO can be used
Related show

Commit Message

Hariprasad Kelam May 25, 2019, 9:15 a.m. UTC
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>
---
 fs/ceph/export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yan, Zheng May 25, 2019, 12:07 p.m. UTC | #1
On 5/25/19 5:15 PM, Hariprasad Kelam wrote:
> 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>
> ---
>   fs/ceph/export.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> index d3ef7ee42..15ff1b0 100644
> --- a/fs/ceph/export.c
> +++ b/fs/ceph/export.c
> @@ -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

Patch
diff mbox series

diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index d3ef7ee42..15ff1b0 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -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;
 }