lkml.org 
[lkml]   [2011]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V4 1/5] dmaengine/dw_dmac: don't call callback routine in case dmaengine_terminate_all() is called
From
Date
On Thu, 2011-05-05 at 17:30 +0530, Viresh Kumar wrote:
> If dmaengine_terminate_all() is called for dma channel, then it doesn't make
> much sense to call registered callback routine. While in case of success or
> failure it must be called.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> ---
> drivers/dma/dw_dmac.c | 31 ++++++++++++++++---------------
> 1 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index 1bd4803..d28cd84 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -195,18 +195,21 @@ static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first)
> /*----------------------------------------------------------------------*/
>

> - /*
> - * The API requires that no submissions are done from a
> - * callback, so we don't need to drop the lock here
> - */
> - if (callback)
> - callback(param);
> + if (callback_required) {
> + if (callback)
> + callback(param);
> + }
How about changing this to:
if (callback_required && callback)
callback(param)
This will make it look cleaner ...


--
~Vinod



\
 
 \ /
  Last update: 2011-05-09 07:37    [W:0.069 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site