Re: [PATCH 3/6] dma: dw_dmac: check direction properly in dw_dma_cyclic_prep

From: Andy Shevchenko
Date: Fri Nov 16 2012 - 10:30:15 EST


On Fri, Nov 16, 2012 at 3:56 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> On Fri, Nov 16, 2012 at 03:59:16PM +0200, Andy Shevchenko wrote:
>> 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.
>
> why above the direction parameter ? You need to explain why ? Is it just
> because 'it looks nicer' or have you found another bug triggered by
> that ?

Many of current users do something like this:

if (dir == MEM_TO_DEV)
{ ... }
*else*
{ ... }

that potentially could trigger the bug.

--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/