2011-03-10 17:40:33

by j223yang

[permalink] [raw]
Subject: [patch]xprt: remove redundant null check

'req' is dereferenced before checked for NULL.
The patch simply removes the check.

Signed-off-by: Jinqiu Yang<[email protected]>
---
xprt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/net/sunrpc/xprt.c 2011-03-10 11:20:16.408039185 -0500
+++ b/net/sunrpc/xprt.c 2011-03-10 11:32:28.132164761 -0500
@@ -202,10 +202,9 @@ 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: