Skip to content

Commit

Permalink
powerpc: Fix size calculation using resource_size()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Dan Carpenter authored and Michael Ellerman committed Aug 10, 2018
1 parent 24576a7 commit c42d3be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/mpic_msgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c42d3be

Please sign in to comment.