]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
spi: pic32: Use proper enum in dmaengine_prep_slave_rg
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 20 Sep 2018 23:13:37 +0000 (16:13 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 21 Sep 2018 01:11:22 +0000 (18:11 -0700)
Clang warns when one enumerated type is converted implicitly to another:

drivers/spi/spi-pic32.c:323:8: warning: implicit conversion from
enumeration type 'enum dma_data_direction' to different enumeration type
'enum dma_transfer_direction' [-Wenum-conversion]
                                          DMA_FROM_DEVICE,
                                          ^~~~~~~~~~~~~~~
drivers/spi/spi-pic32.c:333:8: warning: implicit conversion from
enumeration type 'enum dma_data_direction' to different enumeration type
'enum dma_transfer_direction' [-Wenum-conversion]
                                          DMA_TO_DEVICE,
                                          ^~~~~~~~~~~~~
2 warnings generated.

Use the proper enums from dma_transfer_direction (DMA_FROM_DEVICE =
DMA_DEV_TO_MEM = 2, DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1) to satify Clang.

Link: https://github.com/ClangBuiltLinux/linux/issues/159
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pic32.c

index 46ff76193ee15f01950d5e21e5d4d21ca0d67423..131849adc57072e2a1e73874dc55a1bab4eb01a0 100644 (file)
@@ -320,7 +320,7 @@ static int pic32_spi_dma_transfer(struct pic32_spi *pic32s,
        desc_rx = dmaengine_prep_slave_sg(master->dma_rx,
                                          xfer->rx_sg.sgl,
                                          xfer->rx_sg.nents,
-                                         DMA_FROM_DEVICE,
+                                         DMA_DEV_TO_MEM,
                                          DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc_rx) {
                ret = -EINVAL;
@@ -330,7 +330,7 @@ static int pic32_spi_dma_transfer(struct pic32_spi *pic32s,
        desc_tx = dmaengine_prep_slave_sg(master->dma_tx,
                                          xfer->tx_sg.sgl,
                                          xfer->tx_sg.nents,
-                                         DMA_TO_DEVICE,
+                                         DMA_MEM_TO_DEV,
                                          DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc_tx) {
                ret = -EINVAL;