From patchwork Mon Jul 19 20:30:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 112793 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6JKUZtQ022174 for ; Mon, 19 Jul 2010 20:30:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966702Ab0GSUae (ORCPT ); Mon, 19 Jul 2010 16:30:34 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:58253 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966583Ab0GSUad (ORCPT ); Mon, 19 Jul 2010 16:30:33 -0400 Received: by wyb42 with SMTP id 42so4731400wyb.19 for ; Mon, 19 Jul 2010 13:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=OsMgoVbiFwmt37EqZmt5xZ9jFuEU0lHZ3RP0dUD3RZs=; b=UUtLNg9jKIJQanigCJAA5Lfe6Mml0nF4sXtsuHqeAqB0Iryo331XsMIT7mBwzAglkD /3nvS11qZ4zZubviRhgovIJEEUaCkdXBa+Abrr/bqoc2emnp3wMp979fPPZhh8W/ry6n jy1YxD/LOITjiWyiCu80qH1wuUYLWx510zbPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=TQ1Z59Bdjbr6jJx/TraNvbQhyQtmguiw4CFcIU42sA972HjELaC/ln/jGKfQHHoid0 mAtUC2NPZG8nXgqOTjwc/OgCRfdTQFzs0q8J54Ae1yWnzmGnJzURSnGDudS1n4FnJ6Fz +gIFfZ7GDysBfgGw9RsEF+Df0v5WIV6fY0rcw= Received: by 10.227.144.18 with SMTP id x18mr4592154wbu.105.1279571432114; Mon, 19 Jul 2010 13:30:32 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id p45sm2499905weq.45.2010.07.19.13.30.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Jul 2010 13:30:31 -0700 (PDT) Date: Mon, 19 Jul 2010 22:30:14 +0200 From: Dan Carpenter To: Steve Wise Cc: Steve Wise , Roland Dreier , Sean Hefty , Hal Rosenstock , Frank Zago , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch v2] infiniband: cxgb3: clean up signed check Message-ID: <20100719203014.GN17585@bicker> References: <20100717102900.GG17585@bicker> <4C446509.3010400@opengridcomputing.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4C446509.3010400@opengridcomputing.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 19 Jul 2010 20:30:35 +0000 (UTC) diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c index ae47bfd..6adc13f 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_qp.c +++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c @@ -371,7 +371,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, } num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, qhp->wq.sq_size_log2); - if (num_wrs <= 0) { + if (num_wrs == 0) { spin_unlock_irqrestore(&qhp->lock, flag); err = -ENOMEM; goto out; @@ -554,7 +554,7 @@ int iwch_bind_mw(struct ib_qp *qp, } num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, qhp->wq.sq_size_log2); - if ((num_wrs) <= 0) { + if (num_wrs == 0) { spin_unlock_irqrestore(&qhp->lock, flag); return -ENOMEM; }