Skip to content

Commit

Permalink
omap: Use resource_size
Browse files Browse the repository at this point in the history
Use the resource_size function instead of manually calculating the
resource size. This reduces the chance of introducing off-by-one errors
and actually fixes one in mailbox.c.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tobias Klauser authored and Tony Lindgren committed Nov 11, 2009
1 parent ee90732 commit 6d13524
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
if (r < 0)
goto out;

gpmc_cs_enable_mem(cs, res->start, res->end - res->start + 1);
gpmc_cs_enable_mem(cs, res->start, resource_size(res));
*base = res->start;
gpmc_cs_set_reserved(cs, 1);
out:
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "invalid mem resource\n");
return -ENODEV;
}
mbox_base = ioremap(res->start, res->end - res->start);
mbox_base = ioremap(res->start, resource_size(res));
if (!mbox_base)
return -ENOMEM;

Expand Down

0 comments on commit 6d13524

Please sign in to comment.