Commit db4268f8 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
parent 7ae10eb9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -9,4 +9,10 @@ enum dma_data_direction {
	DMA_NONE = 3,
};

#endif
static inline int valid_dma_direction(enum dma_data_direction dir)
{
	return dir == DMA_BIDIRECTIONAL || dir == DMA_TO_DEVICE ||
		dir == DMA_FROM_DEVICE;
}

#endif /* _LINUX_DMA_DIRECTION_H */
+0 −7
Original line number Diff line number Diff line
@@ -138,13 +138,6 @@ extern const struct dma_map_ops dma_dummy_ops;

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

static inline int valid_dma_direction(int dma_direction)
{
	return ((dma_direction == DMA_BIDIRECTIONAL) ||
		(dma_direction == DMA_TO_DEVICE) ||
		(dma_direction == DMA_FROM_DEVICE));
}

#ifdef CONFIG_DMA_DECLARE_COHERENT
/*
 * These three functions are only for dma allocator.