Re: [PATCH 0/4] dma-mapping: Constify dma_attrs

From: Krzysztof Kozlowski
Date: Wed May 25 2016 - 08:37:23 EST

On 05/24/2016 11:09 AM, Christoph Hellwig wrote:
> I think this is moving into the wrong direction. The right fix here
> is to get of all the dma_attrs boilerplate code and just replace it
> with a simple enum dma_flags. This would simplify both the callers
> and most importantly the wrappers for the flag-less versions a lot.

The dma attrs are additive so maybe not an enum but an unsigned long and

#define DMA_ATTR_WRITE_BARRIER 0x0001u
#define DMA_ATTR_WEAK_ORDERING 0x0002u
#define DMA_ATTR_WRITE_COMBINE 0x0004u

The intrusiveness of it would be similar but indeed looks simpler - when
reading the code and when setting the dma_attrs.

If that seems reasonable, I will send a follow up with new approach.

Thanks for feedback!

Best regards,