Skip to content

Commit db4268f

Browse files
author
Christoph Hellwig
committed
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>
1 parent 7ae10eb commit db4268f

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎include/linux/dma-direction.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ enum dma_data_direction {
99
DMA_NONE = 3,
1010
};
1111

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 */

‎include/linux/dma-mapping.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ extern const struct dma_map_ops dma_dummy_ops;
138138

139139
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
140140

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-
148141
#ifdef CONFIG_DMA_DECLARE_COHERENT
149142
/*
150143
* These three functions are only for dma allocator.

0 commit comments

Comments
 (0)