]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
authorShravya Kumbham <shravya.kumbham@xilinx.com>
Wed, 23 Dec 2020 11:21:02 +0000 (16:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Jan 2021 13:05:36 +0000 (14:05 +0100)
commit 2d5efea64472469117dc1a9a39530069e95b21e9 upstream.

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>
Link: https://lore.kernel.org/r/1608722462-29519-4-git-send-email-radhey.shyam.pandey@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/xilinx/xilinx_dma.c

index e9e5c4ede9fa7a12c3d8fe4189957c837b538ba5..1b5f3e9f43d708015829b15cdb26a8d3808a5a4b 100644 (file)
@@ -2431,7 +2431,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") ||