linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ste_dma40: fix implicit conversion
@ 2015-03-21 23:51 Stefan Agner
  2015-04-01  3:40 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Agner @ 2015-03-21 23:51 UTC (permalink / raw)
  To: linus.walleij, vinod.koul
  Cc: dan.j.williams, dmaengine, linux-arm-kernel, linux-kernel,
	llvmlinux, Stefan Agner

The function d40_prep_sg takes the type enum dma_transfer_direction
as second last parameter. However, the memcpy calls pass DMA_NONE
which is of type enum dma_data_direction. Fix this by passing the
actual transfer direction DMA_MEM_TO_MEM.

This does not change the actual code flow since only the transfer
direction DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are actually used in the
function d40_prep_sg.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
This was uncovered by a LLVM/clang warnings:
drivers/dma/ste_dma40.c:2505:48: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction'
      [-Wenum-conversion]
        return d40_prep_sg(chan, &src_sg, &dst_sg, 1, DMA_NONE, dma_flags);
               ~~~~~~~~~~~                            ^~~~~~~~
drivers/dma/ste_dma40.c:2517:54: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction'
      [-Wenum-conversion]
        return d40_prep_sg(chan, src_sg, dst_sg, src_nents, DMA_NONE, dma_flags);
               ~~~~~~~~~~~                                  ^~~~~~~~

 drivers/dma/ste_dma40.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 15d4946..ace03dc 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2502,7 +2502,8 @@ static struct dma_async_tx_descriptor *d40_prep_memcpy(struct dma_chan *chan,
 	sg_dma_len(&dst_sg) = size;
 	sg_dma_len(&src_sg) = size;
 
-	return d40_prep_sg(chan, &src_sg, &dst_sg, 1, DMA_NONE, dma_flags);
+	return d40_prep_sg(chan, &src_sg, &dst_sg, 1,
+			   DMA_MEM_TO_MEM, dma_flags);
 }
 
 static struct dma_async_tx_descriptor *
@@ -2514,7 +2515,8 @@ d40_prep_memcpy_sg(struct dma_chan *chan,
 	if (dst_nents != src_nents)
 		return NULL;
 
-	return d40_prep_sg(chan, src_sg, dst_sg, src_nents, DMA_NONE, dma_flags);
+	return d40_prep_sg(chan, src_sg, dst_sg, src_nents,
+			   DMA_MEM_TO_MEM, dma_flags);
 }
 
 static struct dma_async_tx_descriptor *
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: ste_dma40: fix implicit conversion
  2015-03-21 23:51 [PATCH] dmaengine: ste_dma40: fix implicit conversion Stefan Agner
@ 2015-04-01  3:40 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2015-04-01  3:40 UTC (permalink / raw)
  To: Stefan Agner
  Cc: linus.walleij, dan.j.williams, dmaengine, linux-arm-kernel,
	linux-kernel, llvmlinux

On Sun, Mar 22, 2015 at 12:51:08AM +0100, Stefan Agner wrote:
> The function d40_prep_sg takes the type enum dma_transfer_direction
> as second last parameter. However, the memcpy calls pass DMA_NONE
> which is of type enum dma_data_direction. Fix this by passing the
> actual transfer direction DMA_MEM_TO_MEM.
> 
> This does not change the actual code flow since only the transfer
> direction DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are actually used in the
> function d40_prep_sg.

Applied, now

-- 
~Vinod


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-01  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21 23:51 [PATCH] dmaengine: ste_dma40: fix implicit conversion Stefan Agner
2015-04-01  3:40 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).