From: Michael Tretter <m.tretter@pengutronix.de>
To: Harini Katakam <harini.katakam@xilinx.com>
Cc: vkoul@kernel.org, romain.perier@gmail.com, allen.lkml@gmail.com,
yukuai3@huawei.com, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com,
michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com,
shravya.kumbham@xilinx.com, kernel@pengutronix.de
Subject: Re: [PATCH 4/4] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning
Date: Thu, 23 Sep 2021 16:17:58 +0200 [thread overview]
Message-ID: <20210923141758.GB30905@pengutronix.de> (raw)
In-Reply-To: <20210914082817.22311-5-harini.katakam@xilinx.com>
On Tue, 14 Sep 2021 13:58:17 +0530, Harini Katakam 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.
>
> Addresses-Coverity: Event mixed_enum_type.
> Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> 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 588460e56ab8..282d01ab402f 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;
Thanks for the patch.
I looked at a few dmaengine drivers, at it looks like all of them have this
issue. Maybe we should change the signature of the dmaengine_prep_dma_memcpy()
engine to accept "enum dma_ctrl_flags flags" instead of "unsigned long flags"?
Michael
> return &first->async_tx;
> }
>
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tretter <m.tretter@pengutronix.de>
To: Harini Katakam <harini.katakam@xilinx.com>
Cc: vkoul@kernel.org, romain.perier@gmail.com, allen.lkml@gmail.com,
yukuai3@huawei.com, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com,
michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com,
shravya.kumbham@xilinx.com, kernel@pengutronix.de
Subject: Re: [PATCH 4/4] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning
Date: Thu, 23 Sep 2021 16:17:58 +0200 [thread overview]
Message-ID: <20210923141758.GB30905@pengutronix.de> (raw)
In-Reply-To: <20210914082817.22311-5-harini.katakam@xilinx.com>
On Tue, 14 Sep 2021 13:58:17 +0530, Harini Katakam 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.
>
> Addresses-Coverity: Event mixed_enum_type.
> Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
> ---
> 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 588460e56ab8..282d01ab402f 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;
Thanks for the patch.
I looked at a few dmaengine drivers, at it looks like all of them have this
issue. Maybe we should change the signature of the dmaengine_prep_dma_memcpy()
engine to accept "enum dma_ctrl_flags flags" instead of "unsigned long flags"?
Michael
> return &first->async_tx;
> }
>
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-23 14:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 8:28 [PATCH 0/4] ZynqMP DMA fixes Harini Katakam
2021-09-14 8:28 ` Harini Katakam
2021-09-14 8:28 ` [PATCH 1/4] dmaengine: zynqmp_dma: Typecast the variable to handle overflow Harini Katakam
2021-09-14 8:28 ` Harini Katakam
2021-09-23 14:11 ` Michael Tretter
2021-09-23 14:11 ` Michael Tretter
2021-10-25 6:10 ` Vinod Koul
2021-10-25 6:10 ` Vinod Koul
2021-09-14 8:28 ` [PATCH 2/4] dmaengine: zynqmp_dma: Typecast the variable with dma_addr_t " Harini Katakam
2021-09-14 8:28 ` Harini Katakam
2021-09-14 8:28 ` [PATCH 3/4] dmaengine: zynqmp_dma: Add conditions for return value check Harini Katakam
2021-09-14 8:28 ` Harini Katakam
2021-09-23 14:40 ` Michael Tretter
2021-09-23 14:40 ` Michael Tretter
2021-10-25 6:12 ` Vinod Koul
2021-10-25 6:12 ` Vinod Koul
2021-09-14 8:28 ` [PATCH 4/4] dmaengine: zynqmp_dma: Typecast with enum to fix the coverity warning Harini Katakam
2021-09-14 8:28 ` Harini Katakam
2021-09-23 14:17 ` Michael Tretter [this message]
2021-09-23 14:17 ` Michael Tretter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210923141758.GB30905@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=allen.lkml@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=harini.katakam@xilinx.com \
--cc=harinikatakamlinux@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=romain.perier@gmail.com \
--cc=shravya.kumbham@xilinx.com \
--cc=vkoul@kernel.org \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.