* dmaengine: timb_dma: Use proper enum in td_prep_slave_sg
@ 2018-09-11 23:20 Nathan Chancellor
0 siblings, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2018-09-11 23:20 UTC (permalink / raw)
To: Dan Williams, Vinod Koul
Cc: dmaengine, linux-kernel, Nick Desaulniers, Nathan Chancellor
Clang warns when implicitly converting from one enumerated type to
another. Avoid this by using the equivalent value from the expected
type.
drivers/dma/timb_dma.c:548:27: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
td_desc->desc_list_len, DMA_MEM_TO_DEV);
^~~~~~~~~~~~~~
1 warning generated.
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/dma/timb_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 395c698edb4d..fc0f9c8766a8 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -545,7 +545,7 @@ static struct dma_async_tx_descriptor *td_prep_slave_sg(struct dma_chan *chan,
}
dma_sync_single_for_device(chan2dmadev(chan), td_desc->txd.phys,
- td_desc->desc_list_len, DMA_MEM_TO_DEV);
+ td_desc->desc_list_len, DMA_TO_DEVICE);
return &td_desc->txd;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* dmaengine: timb_dma: Use proper enum in td_prep_slave_sg
@ 2018-09-11 23:44 Nick Desaulniers
0 siblings, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2018-09-11 23:44 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: dan.j.williams, vkoul, dmaengine, LKML
On Tue, Sep 11, 2018 at 4:20 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> Clang warns when implicitly converting from one enumerated type to
> another. Avoid this by using the equivalent value from the expected
> type.
>
> drivers/dma/timb_dma.c:548:27: warning: implicit conversion from
> enumeration type 'enum dma_transfer_direction' to different enumeration
> type 'enum dma_data_direction' [-Wenum-conversion]
> td_desc->desc_list_len, DMA_MEM_TO_DEV);
> ^~~~~~~~~~~~~~
> 1 warning generated.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> drivers/dma/timb_dma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
> index 395c698edb4d..fc0f9c8766a8 100644
> --- a/drivers/dma/timb_dma.c
> +++ b/drivers/dma/timb_dma.c
> @@ -545,7 +545,7 @@ static struct dma_async_tx_descriptor *td_prep_slave_sg(struct dma_chan *chan,
> }
>
> dma_sync_single_for_device(chan2dmadev(chan), td_desc->txd.phys,
> - td_desc->desc_list_len, DMA_MEM_TO_DEV);
> + td_desc->desc_list_len, DMA_TO_DEVICE);
Looks like DMA_MEM_TO_DEV and DMA_TO_DEVICE happen to have the same
value (today) so no functional change.
And dma_sync_single_for_device is defined to take the `enum
dma_data_direction` which `DMA_TO_DEVICE` is an enumeration of.
Thanks for the patch Nathan.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> return &td_desc->txd;
> }
> --
> 2.18.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* dmaengine: timb_dma: Use proper enum in td_prep_slave_sg
@ 2018-10-02 14:41 Vinod Koul
0 siblings, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2018-10-02 14:41 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: Dan Williams, dmaengine, linux-kernel, Nick Desaulniers
On 11-09-18, 16:20, Nathan Chancellor wrote:
> Clang warns when implicitly converting from one enumerated type to
> another. Avoid this by using the equivalent value from the expected
> type.
>
> drivers/dma/timb_dma.c:548:27: warning: implicit conversion from
> enumeration type 'enum dma_transfer_direction' to different enumeration
> type 'enum dma_data_direction' [-Wenum-conversion]
> td_desc->desc_list_len, DMA_MEM_TO_DEV);
> ^~~~~~~~~~~~~~
> 1 warning generated.
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-02 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 23:20 dmaengine: timb_dma: Use proper enum in td_prep_slave_sg Nathan Chancellor
-- strict thread matches above, loose matches on Subject: below --
2018-09-11 23:44 Nick Desaulniers
2018-10-02 14:41 Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox