Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

omap: rng: Use resource_size instead of manual calculation

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>

authored by

Tobias Klauser and committed by
Tony Lindgren
0fd92a15 44e74840

+2 -2
+2 -2
drivers/char/hw_random/omap-rng.c
··· 116 116 if (!res) 117 117 return -ENOENT; 118 118 119 - mem = request_mem_region(res->start, res->end - res->start + 1, 119 + mem = request_mem_region(res->start, resource_size(res), 120 120 pdev->name); 121 121 if (mem == NULL) { 122 122 ret = -EBUSY; ··· 124 124 } 125 125 126 126 dev_set_drvdata(&pdev->dev, mem); 127 - rng_base = ioremap(res->start, res->end - res->start + 1); 127 + rng_base = ioremap(res->start, resource_size(res)); 128 128 if (!rng_base) { 129 129 ret = -ENOMEM; 130 130 goto err_ioremap;