All of lore.kernel.org
 help / color / mirror / Atom feed
From: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
To: <vkoul@kernel.org>, <dan.j.williams@intel.com>,
	<michal.simek@xilinx.com>, <nick.graumann@gmail.com>,
	<andrea.merello@gmail.com>, <appana.durga.rao@xilinx.com>,
	<mcgrof@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<git@xilinx.com>, Shravya Kumbham <shravya.kumbham@xilinx.com>,
	"Radhey Shyam Pandey" <radhey.shyam.pandey@xilinx.com>
Subject: [PATCH v2 3/3] dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
Date: Wed, 23 Dec 2020 16:51:02 +0530	[thread overview]
Message-ID: <1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com> (raw)
In-Reply-To: <1608722462-29519-1-git-send-email-radhey.shyam.pandey@xilinx.com>

From: Shravya Kumbham <shravya.kumbham@xilinx.com>

Typecast the fls(width -1) with (enum dmaengine_alignment) in
xilinx_dma_chan_probe function to fix the coverity warning.

Addresses-Coverity: Event mixed_enum_type.
Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support")
Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
---
Changes for v2:
- Include fixes tag.
- Keep typecasting changes in the same line to increase readability.
---
 drivers/dma/xilinx/xilinx_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index cf75e2af6381..7639fd07e280 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2801,7 +2801,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 		has_dre = false;
 
 	if (!has_dre)
-		xdev->common.copy_align = fls(width - 1);
+		xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1);
 
 	if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") ||
 	    of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") ||
-- 
2.7.4


  parent reply	other threads:[~2020-12-23 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 11:20 [PATCH v2 0/3] dmaengine: xilinx_dma: coverity fixes Radhey Shyam Pandey
2020-12-23 11:21 ` [PATCH v2 1/3] dmaengine: xilinx_dma: check dma_async_device_register return value Radhey Shyam Pandey
2020-12-23 11:21 ` [PATCH v2 2/3] dmaengine: xilinx_dma: fix incompatible param warning in _child_probe() Radhey Shyam Pandey
2020-12-23 11:21 ` Radhey Shyam Pandey [this message]
2021-01-04 12:42 ` [PATCH v2 0/3] dmaengine: xilinx_dma: coverity fixes Vinod Koul

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=1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com \
    --to=radhey.shyam.pandey@xilinx.com \
    --cc=andrea.merello@gmail.com \
    --cc=appana.durga.rao@xilinx.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=git@xilinx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=nick.graumann@gmail.com \
    --cc=shravya.kumbham@xilinx.com \
    --cc=vkoul@kernel.org \
    /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.