[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcte64KF5k5gDjMtyff8KsOof-yT7iVWc3Gz_ECL+0+Mw@mail.gmail.com>
Date: Fri, 12 Oct 2012 14:25:32 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
vinod.koul@...el.com, linux-kernel@...r.kernel.org,
spear-devel@...t.st.com, linux-arm-kernel@...ts.infradead.org,
devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support
On Fri, Oct 12, 2012 at 2:01 PM, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> On 12 October 2012 16:10, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
>>>>> + if (!found) {
>>>>> + last_dw = dw;
>>>>> + last_bus_id = param;
>>>>> + return false;
>>>> Because of return here you could eliminate 'found' flag at all.
>
> Here is the stuff copied from you ;)
>
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index a4ff04c..c24859e 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1184,7 +1184,7 @@ bool dw_generic_filter(struct dma_chan *chan, void *param)
> struct dw_dma *dw = to_dw_dma(chan->device);
> static struct dw_dma *last_dw;
> static char *last_bus_id;
> - int found = 0, i = -1;
> + int i = -1;
>
> /*
> * dmaengine framework calls this routine for all channels of all dma
> @@ -1212,22 +1212,17 @@ bool dw_generic_filter(struct dma_chan *chan,
> void *param)
>
> while (++i < dw->sd_count) {
> if (!strcmp(dw->sd[i].bus_id, param)) {
> - found = 1;
> - break;
> - }
> - }
> + chan->private = &dw->sd[i];
> + last_dw = NULL;
> + last_bus_id = NULL;
>
> - if (!found) {
> - last_dw = dw;
> - last_bus_id = param;
> - return false;
> + return true;
> + }
> }
>
> - chan->private = &dw->sd[i];
> - last_dw = NULL;
> - last_bus_id = NULL;
> -
> - return true;
> + last_dw = dw;
> + last_bus_id = param;
> + return false;
> }
Yes, that what I refer to.
> EXPORT_SYMBOL(dw_generic_filter);
Could we change a name to be more precise, like dw_dma_generic_filter ?
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists