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

dma-mapping: move valid_dma_direction to dma-direction.h

Move the valid_dma_direction helper to a more suitable header, and
clean it up to use the proper enum as well as removing pointless braces.

Signed-off-by: Christoph Hellwig <hch@lst.de>

+7 -8
+7 -1
include/linux/dma-direction.h
··· 9 9 DMA_NONE = 3, 10 10 }; 11 11 12 - #endif 12 + static inline int valid_dma_direction(enum dma_data_direction dir) 13 + { 14 + return dir == DMA_BIDIRECTIONAL || dir == DMA_TO_DEVICE || 15 + dir == DMA_FROM_DEVICE; 16 + } 17 + 18 + #endif /* _LINUX_DMA_DIRECTION_H */
-7
include/linux/dma-mapping.h
··· 138 138 139 139 #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) 140 140 141 - static inline int valid_dma_direction(int dma_direction) 142 - { 143 - return ((dma_direction == DMA_BIDIRECTIONAL) || 144 - (dma_direction == DMA_TO_DEVICE) || 145 - (dma_direction == DMA_FROM_DEVICE)); 146 - } 147 - 148 141 #ifdef CONFIG_DMA_DECLARE_COHERENT 149 142 /* 150 143 * These three functions are only for dma allocator.