Thread (2 messages) 2 messages, 2 authors, 2023-10-04

[PATCH -next] dmaengine: xilinx: xdma: Use resource_size() in xdma_probe()

From: Li Zetao <hidden>
Date: 2023-08-03 03:33:44
Also in: linux-arm-kernel
Subsystem: dma generic offload engine subsystem, the rest, xilinx xdma driver · Maintainers: Vinod Koul, Linus Torvalds, Lizhi Hou, Brian Xu, Raj Kumar Rampelli

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 <redacted>
---
 drivers/dma/xilinx/xdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index e0bfd129d563..da5410dddfbf 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -885,7 +885,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) {
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help