fix ptr_ret.cocci warnings

Message ID 20181025013101.GA41139@lkp-g5
State New
Headers show
Series
  • fix ptr_ret.cocci warnings
Related show

Commit Message

kbuild test robot Oct. 25, 2018, 1:31 a.m.
From: kbuild test robot <fengguang.wu@intel.com>

fs/nfs/nfs4file.c:345:12-18: 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: 53b276379386 ("NFS inter ssc open")
CC: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Olga-Kornievskaia/client-side-support-for-inter-SSC-copy/20181025-043859
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next

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

Patch

--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -342,7 +342,7 @@  nfs42_ssc_open(struct vfsmount *ss_mnt,
 	res = filep;
 out:
 	dprintk("<-- %s error %ld filep %p r_ino %p\n",
-		__func__, IS_ERR(res) ? PTR_ERR(res) : 0, res, r_ino);
+		__func__, PTR_ERR_OR_ZERO(res), res, r_ino);
 
 	return res;
 out_stateowner: