misc: bcm2835_smi: Use proper enum types for dma_{,un}map_single()
Clang warns: drivers/misc/bcm2835_smi.c:692:4: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] DMA_MEM_TO_DEV); ^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:406:66: note: expanded from macro 'dma_map_single' #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~ ^ drivers/misc/bcm2835_smi.c:705:35: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] (inst->dev, phy_addr, n_bytes, DMA_MEM_TO_DEV); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:407:70: note: expanded from macro 'dma_unmap_single' #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~~~ ^ drivers/misc/bcm2835_smi.c:751:12: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] DMA_DEV_TO_MEM); ^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:406:66: note: expanded from macro 'dma_map_single' #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~ ^ drivers/misc/bcm2835_smi.c:761:50: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_single(inst->dev, phy_addr, n_bytes, DMA_DEV_TO_MEM); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:407:70: note: expanded from macro 'dma_unmap_single' #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~~~ ^ 4 warnings generated. Use the proper enumerated type to clear up the warning. There is not actually a bug here because the enumerated types have the same integer value: DMA_MEM_TO_DEV = DMA_TO_DEVICE = 1 DMA_DEV_TO_MEM = DMA_FROM_DEVICE = 2 Fixes: 93254d0f ("Add SMI driver") Signed-off-by:Nathan Chancellor <nathan@kernel.org>
Loading
Please register or sign in to comment