Re: [PATCH] hw_random: timeriomem-rng: use resource_size

From: Matt Mackall
Date: Thu Jun 02 2011 - 15:25:22 EST


On Wed, 2011-06-01 at 15:23 -0700, H Hartley Sweeten wrote:
> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> Cc: Matt Mackall <mpm@xxxxxxxxxxx>
> Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Looks good to me.

Acked-by: Matt Mackall <mpm@xxxxxxxxxxx>

> ---
>
> diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
> index a94e930..a8428e6 100644
> --- a/drivers/char/hw_random/timeriomem-rng.c
> +++ b/drivers/char/hw_random/timeriomem-rng.c
> @@ -100,8 +100,7 @@ static int __devinit timeriomem_rng_probe(struct platform_device *pdev)
>
> timeriomem_rng_data = pdev->dev.platform_data;
>
> - timeriomem_rng_data->address = ioremap(res->start,
> - res->end - res->start + 1);
> + timeriomem_rng_data->address = ioremap(res->start, resource_size(res));
> if (!timeriomem_rng_data->address)
> return -EIO;
>


--
Mathematics is the supreme nostalgia of our time.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/