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>
This commit is contained in:
Christoph Hellwig
2020-09-11 09:31:32 +02:00
parent 7ae10eb903
commit db4268f8c5
2 changed files with 7 additions and 8 deletions

View File

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