Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-16 Thread Andy Shevchenko
On Thu, 2012-11-15 at 20:05 +0530, viresh kumar wrote: > On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko > wrote: > > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > > > +static inline bool is_slave_direction(enum dma_transfer_direction > > direction) > > +{ > > + return

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-16 Thread Andy Shevchenko
On Thu, 2012-11-15 at 20:05 +0530, viresh kumar wrote: On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c +static inline bool is_slave_direction(enum dma_transfer_direction direction) +{

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread Andy Shevchenko
On Thu, 2012-11-15 at 20:28 +0530, viresh kumar wrote: > On Thu, Nov 15, 2012 at 8:05 PM, viresh kumar wrote: > > On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko > > wrote: > >> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > > > >> +static inline bool is_slave_direction(enum

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread viresh kumar
On Thu, Nov 15, 2012 at 8:05 PM, viresh kumar wrote: > On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko > wrote: >> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > >> +static inline bool is_slave_direction(enum dma_transfer_direction direction) >> +{ >> + return (direction ==

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread viresh kumar
On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko wrote: > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > +static inline bool is_slave_direction(enum dma_transfer_direction direction) > +{ > + return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM); > +} I would

[PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread Andy Shevchenko
dma_transfer_direction is a normal enum. It means we can't usually use the values as bit fields. Let's adjust this check and move it above the usage of the direction parameter. This patch introduces helper function is_slave_direction() that will be used later in other places of the code.

[PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread Andy Shevchenko
dma_transfer_direction is a normal enum. It means we can't usually use the values as bit fields. Let's adjust this check and move it above the usage of the direction parameter. This patch introduces helper function is_slave_direction() that will be used later in other places of the code.

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread viresh kumar
On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c +static inline bool is_slave_direction(enum dma_transfer_direction direction) +{ + return (direction == DMA_MEM_TO_DEV) || (direction ==

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread viresh kumar
On Thu, Nov 15, 2012 at 8:05 PM, viresh kumar viresh.ku...@linaro.org wrote: On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c +static inline bool is_slave_direction(enum dma_transfer_direction

Re: [PATCH 1/2] dw_dmac: check direction properly in dw_dma_cyclic_prep

2012-11-15 Thread Andy Shevchenko
On Thu, 2012-11-15 at 20:28 +0530, viresh kumar wrote: On Thu, Nov 15, 2012 at 8:05 PM, viresh kumar viresh.ku...@linaro.org wrote: On Thu, Nov 15, 2012 at 7:50 PM, Andy Shevchenko andriy.shevche...@linux.intel.com wrote: diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c