From: Viresh Kumar <viresh.kumar@linaro.org> To: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, vinod.koul@intel.com, linux-kernel@vger.kernel.org, spear-devel@list.st.com, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 16:31:31 +0530 [thread overview] Message-ID: <CAKohponxbjTTDMOA_0=MT36wRh1NpzTAH4LdkaE=Z-ahup4BFg@mail.gmail.com> (raw) In-Reply-To: <CAHp75VffAwZjfQLf=wS+nBhiRoMFOoyPeUCfrzF1G=+Kh7HHTA@mail.gmail.com> On 12 October 2012 16:10, Andy Shevchenko <andy.shevchenko@gmail.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; } EXPORT_SYMBOL(dw_generic_filter);
WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 16:31:31 +0530 [thread overview] Message-ID: <CAKohponxbjTTDMOA_0=MT36wRh1NpzTAH4LdkaE=Z-ahup4BFg@mail.gmail.com> (raw) In-Reply-To: <CAHp75VffAwZjfQLf=wS+nBhiRoMFOoyPeUCfrzF1G=+Kh7HHTA@mail.gmail.com> On 12 October 2012 16:10, Andy Shevchenko <andy.shevchenko@gmail.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; } EXPORT_SYMBOL(dw_generic_filter);
next prev parent reply other threads:[~2012-10-12 11:01 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-12 5:43 [PATCH 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar 2012-10-12 5:43 ` Viresh Kumar 2012-10-12 5:43 ` Viresh Kumar 2012-10-12 5:44 ` [PATCH 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar 2012-10-12 5:44 ` Viresh Kumar 2012-10-12 5:47 ` viresh kumar 2012-10-12 5:47 ` viresh kumar 2012-10-12 8:23 ` Andy Shevchenko 2012-10-12 8:23 ` Andy Shevchenko 2012-10-12 8:34 ` Viresh Kumar 2012-10-12 8:34 ` Viresh Kumar 2012-10-12 9:25 ` Andy Shevchenko 2012-10-12 9:25 ` Andy Shevchenko 2012-10-12 9:30 ` Viresh Kumar 2012-10-12 9:30 ` Viresh Kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:36 ` viresh kumar 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:40 ` Andy Shevchenko 2012-10-12 10:48 ` Viresh Kumar 2012-10-12 10:48 ` Viresh Kumar 2012-10-12 11:01 ` Viresh Kumar [this message] 2012-10-12 11:01 ` Viresh Kumar 2012-10-12 11:25 ` Andy Shevchenko 2012-10-12 11:25 ` Andy Shevchenko 2012-10-12 13:44 ` Viresh Kumar 2012-10-12 13:44 ` Viresh Kumar [not found] ` <91e41b4cc972d298f714cbd6f400569a9710304c.1350020375.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:27 ` Andy Shevchenko 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 13:28 ` Shevchenko, Andriy 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:06 ` Viresh Kumar 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:41 ` Shevchenko, Andriy 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 14:47 ` Viresh Kumar 2012-10-12 5:44 ` [PATCH 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar 2012-10-12 5:44 ` Viresh Kumar
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAKohponxbjTTDMOA_0=MT36wRh1NpzTAH4LdkaE=Z-ahup4BFg@mail.gmail.com' \ --to=viresh.kumar@linaro.org \ --cc=andriy.shevchenko@linux.intel.com \ --cc=andy.shevchenko@gmail.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=spear-devel@list.st.com \ --cc=vinod.koul@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.