From patchwork Wed Jun 29 14:09:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Ellis X-Patchwork-Id: 931572 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5U43Duo031534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 30 Jun 2011 04:03:34 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qc8Sz-0004By-0k; Thu, 30 Jun 2011 04:03:01 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qc8Sy-0001Qy-LQ; Thu, 30 Jun 2011 04:03:00 +0000 Received: from us7.mainehost.net ([65.126.238.4]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qc8Sv-0001Qg-6H for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2011 04:02:58 +0000 Received: from 173-162-152-37-newengland.hfc.comcastbusiness.net ([173.162.152.37] helo=[192.168.10.4]) by us7.mainehost.net with esmtpa (Exim 4.69) (envelope-from ) id 1QbvSQ-00017z-1R; Wed, 29 Jun 2011 10:09:34 -0400 Subject: [PATCH] DMA: OMAP: Remove extra looping from omap_request_dma From: Scott Ellis To: linux-omap@vger.kernel.org Date: Wed, 29 Jun 2011 10:09:09 -0400 Message-ID: <1309356549.3995.13.camel@quad> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - us7.mainehost.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jumpnowtek.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110630_000257_340820_6A1D1210 X-CRM114-Status: UNSURE ( 7.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- Cc: Tony Lindgren , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 30 Jun 2011 04:03:34 +0000 (UTC) Break from dma channel search when a free one is found. Signed-off-by: Scott Ellis --- arch/arm/plat-omap/dma.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index c22217c..3d36fcf 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -678,10 +678,9 @@ int omap_request_dma(int dev_id, const char *dev_name, spin_lock_irqsave(&dma_chan_lock, flags); for (ch = 0; ch < dma_chan_count; ch++) { - if (free_ch == -1 && dma_chan[ch].dev_id == -1) { + if (dma_chan[ch].dev_id == -1) { free_ch = ch; - if (dev_id == 0) - break; + break; } } if (free_ch == -1) {