Message ID | CAOh2x=m8OVNfMm5Fn+cr9Gxuh6oyt+8d4n-bkG8Xiw5zGncLiA@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Oct 12, 2012 at 1:36 PM, viresh kumar <viresh.kumar@linaro.org> wrote: > On Fri, Oct 12, 2012 at 1:53 PM, Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: >> On Fri, 2012-10-12 at 11:14 +0530, Viresh Kumar wrote: > >>> + while (++i < dw->sd_count) { >>> + if (!strcmp(dw->sd[i].bus_id, param)) { >>> + found = 1; >>> + break; >>> + } >>> + } >>> + >>> + if (!found) { >>> + last_dw = dw; >>> + last_bus_id = param; >>> + return false; >> Because of return here you could eliminate 'found' flag at all. > how? while (++i < dw->sd_count) { if (!strcmp(dw->sd[i].bus_id, param)) { chan->private = &dw->sd[i]; last_dw = NULL; last_bus_id = NULL; return true; } } last_dw = dw; last_bus_id = param; return false;
On 12 October 2012 16:10, Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Fri, Oct 12, 2012 at 1:36 PM, viresh kumar <viresh.kumar@linaro.org> wrote: >> On Fri, Oct 12, 2012 at 1:53 PM, Andy Shevchenko >> <andriy.shevchenko@linux.intel.com> wrote: >>> On Fri, 2012-10-12 at 11:14 +0530, Viresh Kumar wrote: >> >>>> + while (++i < dw->sd_count) { >>>> + if (!strcmp(dw->sd[i].bus_id, param)) { >>>> + found = 1; >>>> + break; I was just not looking at this place. >>>> + } >>>> + } >>>> + >>>> + if (!found) { >>>> + last_dw = dw; >>>> + last_bus_id = param; >>>> + return false; >>> Because of return here you could eliminate 'found' flag at all. >> how? And was looking here only. > while (++i < dw->sd_count) { > if (!strcmp(dw->sd[i].bus_id, param)) { > chan->private = &dw->sd[i]; > last_dw = NULL; > last_bus_id = NULL; > > return true; > } > } > > last_dw = dw; > last_bus_id = param; > return false; will be done.
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 9a7d084..a4ff04c 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -1598,9 +1598,10 @@ __devinit dw_dma_parse_dt(struct platform_device *pdev) return pdata; } #else -static inline int dw_dma_parse_dt(struct platform_device *pdev) +static inline struct dw_dma_platform_data * +dw_dma_parse_dt(struct platform_device *pdev) { - return -ENOSYS; + return NULL; } #endif