Re: [PATCH 2/2] kernel/dma: rename dma_alloc_direct and dma_map_direct

Christoph Hellwig
2022-02-22T15:59:54Z

On Tue, Feb 22, 2022 at 09:42:22PM +0800, Baoquan He wrote:
> In the old dma mapping, coherent mapping uses dma_alloc_coherent() to
> allocate DMA buffer and mapping; while streaming mapping can only get
> memory from slab or buddy allocator, then map with dma_map_single().
> In that situation, dma_alloc_direct() checks a direct mapping for
> coherent DMA, dma_map_direct() checks a direct mapping for streaming
> DMA.
>
> However, several new APIs have been added for streaming mapping, e.g
> dma_alloc_pages(). These new APIs take care of DMA buffer allocating
> and mapping which are similar with dma_alloc_coherent(). So we should
> rename both of them to reflect their real intention to avoid confusion.
>
> dma_alloc_direct() ==> dma_coherent_direct()
> dma_map_direct() ==> dma_streaming_direct()

No, these new names are highly misleading.