Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: simplify get_arch_dma_ops

Remove the indirection through the dma_ops variable, and just return
nommu_dma_ops directly from get_arch_dma_ops.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>

+3 -23
+2 -3
arch/sh/include/asm/dma-mapping.h
··· 2 2 #ifndef __ASM_SH_DMA_MAPPING_H 3 3 #define __ASM_SH_DMA_MAPPING_H 4 4 5 - extern const struct dma_map_ops *dma_ops; 6 - extern void no_iommu_init(void); 5 + extern const struct dma_map_ops nommu_dma_ops; 7 6 8 7 static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) 9 8 { 10 - return dma_ops; 9 + return &nommu_dma_ops; 11 10 } 12 11 13 12 extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
+1 -7
arch/sh/kernel/dma-nommu.c
··· 79 79 .sync_sg_for_device = nommu_sync_sg_for_device, 80 80 #endif 81 81 }; 82 - 83 - void __init no_iommu_init(void) 84 - { 85 - if (dma_ops) 86 - return; 87 - dma_ops = &nommu_dma_ops; 88 - } 82 + EXPORT_SYMBOL(nommu_dma_ops);
-3
arch/sh/mm/consistent.c
··· 20 20 #include <asm/cacheflush.h> 21 21 #include <asm/addrspace.h> 22 22 23 - const struct dma_map_ops *dma_ops; 24 - EXPORT_SYMBOL(dma_ops); 25 - 26 23 void *dma_generic_alloc_coherent(struct device *dev, size_t size, 27 24 dma_addr_t *dma_handle, gfp_t gfp, 28 25 unsigned long attrs)
-10
arch/sh/mm/init.c
··· 339 339 free_area_init_nodes(max_zone_pfns); 340 340 } 341 341 342 - /* 343 - * Early initialization for any I/O MMUs we might have. 344 - */ 345 - static void __init iommu_init(void) 346 - { 347 - no_iommu_init(); 348 - } 349 - 350 342 unsigned int mem_init_done = 0; 351 343 352 344 void __init mem_init(void) 353 345 { 354 346 pg_data_t *pgdat; 355 - 356 - iommu_init(); 357 347 358 348 high_memory = NULL; 359 349 for_each_online_pgdat(pgdat)