summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-08-08 14:57:24 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-10 22:12:33 +1000
commitc42d3be0c06f0c1c416054022aa535c08a1f9b39 (patch)
treee9aa55a3f2c35a300251b5defaeb9c54118574d2 /arch/powerpc/sysdev
parent24576a70e7dfa703617a5e7ae8e6cbd66cfb6e5d (diff)
downloadlinux-c42d3be0c06f0c1c416054022aa535c08a1f9b39.tar.gz
linux-c42d3be0c06f0c1c416054022aa535c08a1f9b39.tar.bz2
linux-c42d3be0c06f0c1c416054022aa535c08a1f9b39.zip
powerpc: Fix size calculation using resource_size()
The problem is the the calculation should be "end - start + 1" but the plus one is missing in this calculation. Fixes: 8626816e905e ("powerpc: add support for MPIC message register API") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/mpic_msgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index eb69a5186243..280e964e1aa8 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
/* IO map the message register block. */
of_address_to_resource(np, 0, &rsrc);
- msgr_block_addr = ioremap(rsrc.start, rsrc.end - rsrc.start);
+ msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
if (!msgr_block_addr) {
dev_err(&dev->dev, "Failed to iomap MPIC message registers");
return -EFAULT;