Skip to content

Commit

Permalink
omap: rng: Use resource_size instead of manual calculation
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.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
  • Loading branch information
Tobias Klauser authored and Tony Lindgren committed Sep 24, 2009
1 parent 44e7484 commit 0fd92a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/hw_random/omap-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ static int __devinit omap_rng_probe(struct platform_device *pdev)
if (!res)
return -ENOENT;

mem = request_mem_region(res->start, res->end - res->start + 1,
mem = request_mem_region(res->start, resource_size(res),
pdev->name);
if (mem == NULL) {
ret = -EBUSY;
goto err_region;
}

dev_set_drvdata(&pdev->dev, mem);
rng_base = ioremap(res->start, res->end - res->start + 1);
rng_base = ioremap(res->start, resource_size(res));
if (!rng_base) {
ret = -ENOMEM;
goto err_ioremap;
Expand Down

0 comments on commit 0fd92a1

Please sign in to comment.