From patchwork Wed Mar 16 06:45:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: j223yang@asset.uwaterloo.ca X-Patchwork-Id: 638631 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2G78iic029754 for ; Wed, 16 Mar 2011 07:08:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862Ab1CPHIm (ORCPT ); Wed, 16 Mar 2011 03:08:42 -0400 Received: from asset.uwaterloo.ca ([129.97.92.29]:48081 "EHLO asset.uwaterloo.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792Ab1CPHIl (ORCPT ); Wed, 16 Mar 2011 03:08:41 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Mar 2011 07:08:45 +0000 (UTC) X-Greylist: delayed 1410 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Mar 2011 03:08:41 EDT Received: from asset.uwaterloo.ca (localhost.localdomain [127.0.0.1]) by asset.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id p2G6jA3M001503; Wed, 16 Mar 2011 02:45:10 -0400 Received: (from j223yang@localhost) by asset.uwaterloo.ca (8.14.4/8.14.4/Submit) id p2G6j9XJ001501; Wed, 16 Mar 2011 02:45:09 -0400 Date: Wed, 16 Mar 2011 02:45:09 -0400 From: j223yang@asset.uwaterloo.ca To: linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [patch]xprt: remove redundant checks Message-ID: <20110316064509.GA1498@asset.uwaterloo.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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);