Skip to contentSkip to conversation

nfs: Use PTR_ERR_OR_ZERO in 'nfs41_callback_up' function

PATCH In review Geyslan G. Bem 1 participant 4 messages Oct 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nfs: Use PTR_ERR_OR_ZERO in 'nfs41_callback_up' function

Use 'PTR_ERR_OR_ZERO()' rather than 'IS_ERR(...) ? PTR_ERR(...) : 0'.

---
 fs/nfs/callback.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/callback.c +1 -2
index 67cd732..073b4cf 100644
@@ -164,8 +164,7 @@ nfs41_callback_up(struct svc_serv *serv)
 		svc_xprt_put(serv->sv_bc_xprt);
 		serv->sv_bc_xprt = NULL;
 	}
-	dprintk("--> %s return %ld\n", __func__,
-		IS_ERR(rqstp) ? PTR_ERR(rqstp) : 0);
+	dprintk("--> %s return %d\n", __func__, PTR_ERR_OR_ZERO(rqstp));
 	return rqstp;
 }
 
Signature · 1 line
1.8.4
#1 lore raw

PATCH v2 1/1 nfs: Use PTR_ERR_OR_ZERO in 'nfs/nfs4super.c'

Use 'PTR_ERR_OR_ZERO()' rather than 'IS_ERR(...) ? PTR_ERR(...) : 0'.

---
 fs/nfs/nfs4super.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/nfs/nfs4super.c +6 -6
index e26acdd..65ab0a0 100644
@@ -261,9 +261,9 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,
 
 	res = nfs_follow_remote_path(root_mnt, export_path);
 
-	dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n",
-			IS_ERR(res) ? PTR_ERR(res) : 0,
-			IS_ERR(res) ? " [error]" : "");
+	dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n",
+		 PTR_ERR_OR_ZERO(res),
+		 IS_ERR(res) ? " [error]" : "");
 	return res;
 }
 
@@ -319,9 +319,9 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
 	data->mnt_path = export_path;
 
 	res = nfs_follow_remote_path(root_mnt, export_path);
-	dprintk("<-- nfs4_referral_mount() = %ld%s\n",
-			IS_ERR(res) ? PTR_ERR(res) : 0,
-			IS_ERR(res) ? " [error]" : "");
+	dprintk("<-- nfs4_referral_mount() = %d%s\n",
+		PTR_ERR_OR_ZERO(res),
+		IS_ERR(res) ? " [error]" : "");
 	return res;
 }
 
Signature · 1 line
1.8.4
#2 lore raw

Re: [PATCH v2] nfs: Use PTR_ERR_OR_ZERO in 'nfs/nfs4super.c'

2013/10/14 Geyslan G. Bem <[email protected]>:

Quoted 38 lines

Use 'PTR_ERR_OR_ZERO()' rather than 'IS_ERR(...) ? PTR_ERR(...) : 0'.

---
 fs/nfs/nfs4super.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/nfs/nfs4super.c +6 -7
index e26acdd..65ab0a0 100644
@@ -261,9 +261,9 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name,
 
        res = nfs_follow_remote_path(root_mnt, export_path);
 
-       dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n",
-                       IS_ERR(res) ? PTR_ERR(res) : 0,
-                       IS_ERR(res) ? " [error]" : "");
+       dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n",
+                PTR_ERR_OR_ZERO(res),
+                IS_ERR(res) ? " [error]" : "");
        return res;
 }
 
@@ -319,9 +319,9 @@ static struct dentry *nfs4_referral_mount(struct file_system_type *fs_type,
        data->mnt_path = export_path;
 
        res = nfs_follow_remote_path(root_mnt, export_path);
-       dprintk("<-- nfs4_referral_mount() = %ld%s\n",
-                       IS_ERR(res) ? PTR_ERR(res) : 0,
-                       IS_ERR(res) ? " [error]" : "");
+       dprintk("<-- nfs4_referral_mount() = %d%s\n",
+               PTR_ERR_OR_ZERO(res),
+               IS_ERR(res) ? " [error]" : "");
        return res;
 }
 
--
Quoted 2 lines

1.8.4

In this version (v2):
Format changed from %ld to %d.

#3 lore raw
In reply to Geyslan G. Bem

2013/10/14 Geyslan G. Bem <[email protected]>:

Quoted 22 lines

Use 'PTR_ERR_OR_ZERO()' rather than 'IS_ERR(...) ? PTR_ERR(...) : 0'.

---
 fs/nfs/callback.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/callback.c +1 -3
index 67cd732..073b4cf 100644
@@ -164,8 +164,7 @@ nfs41_callback_up(struct svc_serv *serv)
                svc_xprt_put(serv->sv_bc_xprt);
                serv->sv_bc_xprt = NULL;
        }
-       dprintk("--> %s return %ld\n", __func__,
-               IS_ERR(rqstp) ? PTR_ERR(rqstp) : 0);
+       dprintk("--> %s return %d\n", __func__, PTR_ERR_OR_ZERO(rqstp));
        return rqstp;
 }
 
--
Quoted 2 lines

1.8.4

In this version (v2):
Format changed from %ld to %d.