Message ID | 20180319221622.16867-1-stefan@agner.ch (mailing list archive) |
---|---|
State | Accepted |
Commit | 768d59f5d0139a6ff09e4430ec29cdc8b436421a |
Headers | show |
Hi Stefan, On Mon, Mar 19, 2018 at 11:16 PM, Stefan Agner <stefan@agner.ch> wrote: > Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg > instead of enum dma_data_direction. This won't change behavior in > practice as the enum values are equivalent. Thanks for catching! BTW, spi-sh-msiof has the same issue. Will sent a fix. > This fixes two warnings when building with clang: > drivers/spi/spi-rspi.c:538:26: warning: implicit conversion from enumeration > type 'enum dma_data_direction' to different enumeration type > 'enum dma_transfer_direction' [-Wenum-conversion] > rx->sgl, rx->nents, DMA_FROM_DEVICE, > ^~~~~~~~~~~~~~~ > drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration > type 'enum dma_data_direction' to different enumeration type > 'enum dma_transfer_direction' [-Wenum-conversion] > tx->sgl, tx->nents, DMA_TO_DEVICE, > ^~~~~~~~~~~~~ > > Signed-off-by: Stefan Agner <stefan@agner.ch> JFTR, as it's already applied Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 0835a8d88fb8..95dc4d78618d 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -535,7 +535,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, /* First prepare and submit the DMA request(s), as this may fail */ if (rx) { desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx, - rx->sgl, rx->nents, DMA_FROM_DEVICE, + rx->sgl, rx->nents, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc_rx) { ret = -EAGAIN; @@ -555,7 +555,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, if (tx) { desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx, - tx->sgl, tx->nents, DMA_TO_DEVICE, + tx->sgl, tx->nents, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc_tx) { ret = -EAGAIN;
Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg instead of enum dma_data_direction. This won't change behavior in practice as the enum values are equivalent. This fixes two warnings when building with clang: drivers/spi/spi-rspi.c:538:26: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] rx->sgl, rx->nents, DMA_FROM_DEVICE, ^~~~~~~~~~~~~~~ drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] tx->sgl, tx->nents, DMA_TO_DEVICE, ^~~~~~~~~~~~~ Signed-off-by: Stefan Agner <stefan@agner.ch> --- drivers/spi/spi-rspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)