• Nathan Chancellor's avatar
    mtd: spi-nor: cadence-quadspi: Use proper enum for dma_[un]map_single · 900f5e0d
    Nathan Chancellor authored
    Clang warns when one enumerated type is converted implicitly to another.
    
    drivers/mtd/spi-nor/cadence-quadspi.c:962:47: warning: implicit
    conversion from enumeration type 'enum dma_transfer_direction' to
    different enumeration type 'enum dma_data_direction' [-Wenum-conversion]
            dma_dst = dma_map_single(nor->dev, buf, len, DMA_DEV_TO_MEM);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    ./include/linux/dma-mapping.h:428:66: note: expanded from macro
    'dma_map_single'
                                       ~~~~~~~~~~~~~~~~~~~~          ^
    drivers/mtd/spi-nor/cadence-quadspi.c:997:43: warning: implicit
    conversion from enumeration type 'enum dma_transfer_direction' to
    different enumeration type 'enum dma_data_direction' [-Wenum-conversion]
            dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    ./include/linux/dma-mapping.h:429:70: note: expanded from macro
    'dma_unmap_single'
                                         ~~~~~~~~~~~~~~~~~~~~~~          ^
    2 warnings generated.
    
    Use the proper enums from dma_data_direction to satisfy Clang.
    
    DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/108Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
    900f5e0d
cadence-quadspi.c 37.9 KB