summaryrefslogtreecommitdiff
path: root/include/linux/dma-direction.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-11 10:31:32 +0300
committerChristoph Hellwig <hch@lst.de>2020-09-25 07:12:25 +0300
commitdb4268f8c575617bacdeff862c7de674dbf65075 (patch)
tree8b9570bf4f6443537a9f808be1c5b528075958c6 /include/linux/dma-direction.h
parent7ae10eb903d6ed9b3069fe1dc175b36d86667d09 (diff)
downloadlinux-db4268f8c575617bacdeff862c7de674dbf65075.tar.xz
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>
Diffstat (limited to 'include/linux/dma-direction.h')
-rw-r--r--include/linux/dma-direction.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
index 9c96e30e6a0b..a2fe4571bc92 100644
--- a/include/linux/dma-direction.h
+++ b/include/linux/dma-direction.h
@@ -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 */