Thread (3 messages) 3 messages, 2 authors, 2022-09-05

[PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning

From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Date: 2022-05-24 07:49:30
Also in: lkml
Subsystem: dma generic offload engine subsystem, the rest · Maintainers: Vinod Koul, Linus Torvalds

From: Shravya Kumbham <redacted>

Typecast the flags variable with (enum dma_ctrl_flags) in
zynqmp_dma_prep_memcpy function to fix the coverity warning.

Addresses-Coverity: Event mixed_enum_type.
Signed-off-by: Shravya Kumbham <redacted>
Signed-off-by: Harini Katakam <redacted>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
NOTE- This patch was sent to dmaengine mailing list[1] and
there was a suggestion from Michael Tretter to change the
signature of the dmaengine_prep_dma_memcpy() engine to accept
"enum dma_ctrl_flags flags" instead of "unsigned long flags".

All device_prep_dma_* API variants have ulong flags argument.
So this is a wider question if we want to change these APIs?
Also there are existing users of these public APIs.

[1]: https://lore.kernel.org/linux-arm-kernel/20210914082817.22311-2-harini.katakam@xilinx.com/t/#m1d1bc959f500b04fa1470caa31239a95c73fd45d (local)
---
 drivers/dma/xilinx/zynqmp_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index dc299ab36818..3f4ee3954384 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -849,7 +849,7 @@ static struct dma_async_tx_descriptor *zynqmp_dma_prep_memcpy(
 
 	zynqmp_dma_desc_config_eod(chan, desc);
 	async_tx_ack(&first->async_tx);
-	first->async_tx.flags = flags;
+	first->async_tx.flags = (enum dma_ctrl_flags)flags;
 	return &first->async_tx;
 }
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help