* [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning
@ 2022-05-24 7:49 Radhey Shyam Pandey
2022-07-21 14:23 ` Pandey, Radhey Shyam
2022-09-05 6:26 ` Vinod Koul
0 siblings, 2 replies; 3+ messages in thread
From: Radhey Shyam Pandey @ 2022-05-24 7:49 UTC (permalink / raw)
To: vkoul, michal.simek, m.tretter
Cc: dmaengine, linux-kernel, git, Shravya Kumbham, Harini Katakam,
Radhey Shyam Pandey
From: Shravya Kumbham <shravya.kumbham@xilinx.com>
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 <shravya.kumbham@xilinx.com>
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
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
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning
2022-05-24 7:49 [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning Radhey Shyam Pandey
@ 2022-07-21 14:23 ` Pandey, Radhey Shyam
2022-09-05 6:26 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Pandey, Radhey Shyam @ 2022-07-21 14:23 UTC (permalink / raw)
To: Pandey, Radhey Shyam, vkoul@kernel.org, Simek, Michal,
m.tretter@pengutronix.de
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
git (AMD-Xilinx), Shravya Kumbham, Katakam, Harini
> -----Original Message-----
> From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> Sent: Tuesday, May 24, 2022 1:19 PM
> To: vkoul@kernel.org; Michal Simek <michals@xilinx.com>;
> m.tretter@pengutronix.de
> Cc: dmaengine@vger.kernel.org; linux-kernel@vger.kernel.org;
> git@amd.com; Shravya Kumbham <shravyak@xlnx.xilinx.com>; Harini
> Katakam <harinik@xilinx.com>; Radhey Shyam Pandey
> <radhey.shyam.pandey@amd.com>
> Subject: [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the
> coverity warning
>
> From: Shravya Kumbham <shravya.kumbham@xilinx.com>
>
> 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 <shravya.kumbham@xilinx.com>
> Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
> 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/#m1d1bc959f500b04fa1470caa31239a95c73fd
> 45d
> ---
> 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;
> }
>
> --
Ping! for review.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning
2022-05-24 7:49 [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning Radhey Shyam Pandey
2022-07-21 14:23 ` Pandey, Radhey Shyam
@ 2022-09-05 6:26 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2022-09-05 6:26 UTC (permalink / raw)
To: Radhey Shyam Pandey
Cc: michal.simek, m.tretter, dmaengine, linux-kernel, git,
Shravya Kumbham, Harini Katakam
On 24-05-22, 13:19, Radhey Shyam Pandey wrote:
> From: Shravya Kumbham <shravya.kumbham@xilinx.com>
>
> Typecast the flags variable with (enum dma_ctrl_flags) in
> zynqmp_dma_prep_memcpy function to fix the coverity warning.
Applied, thanks
>
> Addresses-Coverity: Event mixed_enum_type.
> Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
> Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
> 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.
It would be very nice to do this change but users would need to be
updated as well, patches are welcome
--
~Vinod
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-05 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24 7:49 [PATCH] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning Radhey Shyam Pandey
2022-07-21 14:23 ` Pandey, Radhey Shyam
2022-09-05 6:26 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox