浏览代码

xprt: remove redundant null check

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

Signed-off-by: Jinqiu Yang<crindy646@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
j223yang@asset.uwaterloo.ca 14 年之前
父节点
当前提交
4d4a76f330
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      net/sunrpc/xprt.c

+ 3 - 4
net/sunrpc/xprt.c

@@ -202,10 +202,9 @@ int xprt_reserve_xprt(struct rpc_task *task)
 		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: