lkml.org 
[lkml]   [2011]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch]xprt: remove redundant checks
'req' is already dereferenced in 
'struct rpc_xprt *xprt = req->rq_xprt;',
but check again later in the function.
The patch removes these redundant checks.

Signed-off-by: Jinqiu Yang <crindy646@gmail.com>
---
xprt.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/sunrpt/xprt.c b/net/sunrpt/xprt.c
--- a/net/sunrpc/xprt.c 2011-03-16 00:10:08.764164573 -0400
+++ b/net/sunrpt/xprt.c 2011-03-16 02:33:38.559164414 -0400
@@ -202,10 +202,8 @@ int xprt_reserve_xprt(struct rpc_task *t
goto out_sleep;
}
xprt->snd_task = task;
- if (req) {
- req->rq_bytes_sent = 0;
- req->rq_ntrans++;
- }
+ req->rq_bytes_sent = 0;
+ req->rq_ntrans++;
return 1;

out_sleep:
@@ -213,7 +211,7 @@ out_sleep:
task->tk_pid, xprt);
task->tk_timeout = 0;
task->tk_status = -EAGAIN;
- if (req && req->rq_ntrans)
+ if (req->rq_ntrans)
rpc_sleep_on(&xprt->resend, task, NULL);
else
rpc_sleep_on(&xprt->sending, task, NULL);

\
 
 \ /
  Last update: 2011-03-16 07:47    [W:0.054 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site