]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
irqchip/mvebu-gicp: Use resource_size() for ioremap()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 6 Aug 2025 14:53:18 +0000 (16:53 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 6 Aug 2025 15:00:40 +0000 (17:00 +0200)
0-day reported an off by one in the ioremap() sizing:

  drivers/irqchip/irq-mvebu-gicp.c:240:45-48: WARNING:
  Suspicious code. resource_size is maybe missing with gicp -> res

Convert it to resource_size(), which does the right thing.

Fixes: 3c3d7dbab2c7 ("irqchip/mvebu-gicp: Clear pending interrupts on init")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Closes: https://lore.kernel.org/oe-kbuild-all/202508062150.mtFQMTXc-lkp@intel.com/
drivers/irqchip/irq-mvebu-gicp.c

index fd85c845e0151fed18d5185937118ba25e239af7..54833717f8a70f3e2b6340ac7df696c68bb8a723 100644 (file)
@@ -237,7 +237,7 @@ static int mvebu_gicp_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       base = ioremap(gicp->res->start, gicp->res->end - gicp->res->start);
+       base = ioremap(gicp->res->start, resource_size(gicp->res));
        if (IS_ERR(base)) {
                dev_err(&pdev->dev, "ioremap() failed. Unable to clear pending interrupts.\n");
        } else {