Skip to content

Commit c42d3be

Browse files
Dan Carpentermpe
authored andcommitted
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: 8626816 ("powerpc: add support for MPIC message register API") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Tyrel Datwyler <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 24576a7 commit c42d3be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/sysdev/mpic_msgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)
196196

197197
/* IO map the message register block. */
198198
of_address_to_resource(np, 0, &rsrc);
199-
msgr_block_addr = ioremap(rsrc.start, rsrc.end - rsrc.start);
199+
msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc));
200200
if (!msgr_block_addr) {
201201
dev_err(&dev->dev, "Failed to iomap MPIC message registers");
202202
return -EFAULT;

0 commit comments

Comments
 (0)