Skip to contentSkip to conversation

arm64: Change misleading function names in dma-mapping

PATCH New Will Deacon 2 participants 2 messages Feb 6, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CAD15agZzJ4=RMbky+GymJbyktLz0PO+uZ-GOh1SbvH476k4hzA@mail.gmail.com

#1 lore raw

PATCH 1/1 arm64: Change misleading function names in dma-mapping

Quoted 9 lines · Ritesh Harjani

From: Ritesh Harjani <ritesh.harjani at gmail.com<mailto:[email protected]>>

arm64_swiotlb_alloc/free_coherent name can be misleading somtimes with CMA support being enabled after this patch (c2104debc235b745265b64d610237a6833fd53)

Change this name to be more generic:
arm64_dma_alloc/free_coherent

I'm fine with this cosmetic change, but the (pre-existing) arm64 prefix looks a little odd for a static function.

Will

Quoted 42 lines
Signed-off-by Ritesh Harjani <ritesh.harjani at gmail.com<mailto:[email protected]>>
---
 arch/arm64/mm/dma-mapping.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/mm/dma-mapping.c +4 -5
index 45b5ab5..7517796 100644
@@ -30,7 +30,7 @@
 struct dma_map_ops *dma_ops;
 EXPORT_SYMBOL(dma_ops);
 
-static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size,
+static void *arm64_dma_alloc_coherent(struct device *dev, size_t size,
                                          dma_addr_t *dma_handle, gfp_t flags,
                                          struct dma_attrs *attrs)
 {
@@ -57,7 +57,7 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size,
        }
 }
 
-static void arm64_swiotlb_free_coherent(struct device *dev, size_t size,
+static void arm64_dma_free_coherent(struct device *dev, size_t size,
                                        void *vaddr, dma_addr_t dma_handle,
                                        struct dma_attrs *attrs)
 {
@@ -78,8 +78,8 @@ static void arm64_swiotlb_free_coherent(struct device *dev, size_t size,
 }
 
 static struct dma_map_ops arm64_swiotlb_dma_ops = {
-       .alloc = arm64_swiotlb_alloc_coherent,
-       .free = arm64_swiotlb_free_coherent,
+       .alloc = arm64_dma_alloc_coherent,
+       .free = arm64_dma_free_coherent,
        .map_page = swiotlb_map_page,
        .unmap_page = swiotlb_unmap_page,
        .map_sg = swiotlb_map_sg_attrs,
--

1.8.1.3

#2 lore raw

PATCH 1/1 arm64: Change misleading function names in dma-mapping

Quoted 8 lines · Will Deacon
Quoted 7 lines · Ritesh Harjani

From: Ritesh Harjani <ritesh.harjani at gmail.com<mailto:[email protected]>>

arm64_swiotlb_alloc/free_coherent name can be misleading somtimes with CMA support being enabled after this patch (c2104debc235b745265b64d610237a6833fd53)

Quoted 5 lines
Quoted 2 lines

Change this name to be more generic:
arm64_dma_alloc/free_coherent

I'm fine with this cosmetic change, but the (pre-existing) arm64 prefix looks a little odd for a static function.

Good point. I'm happy with a simpler __dma_alloc_coherent().

Signature · 1 line
Catalin