Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755791AbbLAIlz (ORCPT ); Tue, 1 Dec 2015 03:41:55 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:38686 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755732AbbLAIlw (ORCPT ); Tue, 1 Dec 2015 03:41:52 -0500 Subject: Re: [RFC v02 02/15] dmaengine: core: Move and merge the code paths using private_candidate To: Andy Shevchenko References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-3-git-send-email-peter.ujfalusi@ti.com> CC: Vinod Koul , Arnd Bergmann , "linux-kernel@vger.kernel.org" , dmaengine , Linux OMAP Mailing List , linux-arm Mailing List , "linux-mmc@vger.kernel.org" , Sekhar Nori , linux-spi From: Peter Ujfalusi Message-ID: <565D5D2E.4020000@ti.com> Date: Tue, 1 Dec 2015 10:41:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1522 Lines: 39 On 11/30/2015 04:42 PM, Andy Shevchenko wrote: > On Mon, Nov 30, 2015 at 3:45 PM, Peter Ujfalusi wrote: >> Channel matching with private_candidate() is used in two paths, the error >> checking is slightly different in them and they are duplicating code also. >> Move the code under dma_get_channel() to provide consistent execution and >> going to allow us to reuse this mode of channel lookup later. >> >> Signed-off-by: Peter Ujfalusi >> --- >> drivers/dma/dmaengine.c | 81 +++++++++++++++++++++++++------------------------ >> 1 file changed, 42 insertions(+), 39 deletions(-) >> >> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c >> index 52c3eee48e2e..1249165fb4b2 100644 >> --- a/drivers/dma/dmaengine.c >> +++ b/drivers/dma/dmaengine.c >> @@ -549,6 +549,42 @@ static struct dma_chan *private_candidate(const dma_cap_mask_t *mask, >> return NULL; >> } >> >> +static struct dma_chan *dma_get_channel(struct dma_device *device, > > Naming scheme inside dmaengine.c looks like a mess. Yes, I agree. > > Since it's static function that utilizes private_candidate() may I > propose the name like find_candidate() ? I had __* version as well, but the find_candidate() sounds better. Thanks, Péter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/