]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: xilinx: xdma: Use resource_size() in xdma_probe()
authorLi Zetao <lizetao1@huawei.com>
Thu, 3 Aug 2023 03:32:35 +0000 (11:32 +0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 4 Oct 2023 13:57:51 +0000 (19:27 +0530)
There is a warning reported by coccinelle:

./drivers/dma/xilinx/xdma.c:888:22-25: ERROR:
Missing resource_size with   res

Use resource_size() on resource object instead of explicit computation.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230803033235.3049137-1-lizetao1@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xdma.c

index 459e7b9838ed5f2d7a812528f7be779b18eda928..78a8eef5dcf7b4a5521ff20e97d5d806f67d8133 100644 (file)
@@ -883,7 +883,7 @@ static int xdma_probe(struct platform_device *pdev)
                goto failed;
        }
        xdev->irq_start = res->start;
-       xdev->irq_num = res->end - res->start + 1;
+       xdev->irq_num = resource_size(res);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {