2011-06-01 22:23:35

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] hw_random: timeriomem-rng: use resource_size

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Matt Mackall <[email protected]>
Cc: Herbert Xu <[email protected]>

---

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;


2011-06-02 19:25:17

by Matt Mackall

[permalink] [raw]
Subject: Re: [PATCH] hw_random: timeriomem-rng: use resource_size

On Wed, 2011-06-01 at 15:23 -0700, H Hartley Sweeten wrote:
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Matt Mackall <[email protected]>
> Cc: Herbert Xu <[email protected]>

Looks good to me.

Acked-by: Matt Mackall <[email protected]>

> ---
>
> 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.

2011-06-08 13:06:14

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] hw_random: timeriomem-rng: use resource_size

On Thu, Jun 02, 2011 at 02:25:11PM -0500, Matt Mackall wrote:
> On Wed, 2011-06-01 at 15:23 -0700, H Hartley Sweeten wrote:
> > Signed-off-by: H Hartley Sweeten <[email protected]>
> > Cc: Matt Mackall <[email protected]>
> > Cc: Herbert Xu <[email protected]>
>
> Looks good to me.
>
> Acked-by: Matt Mackall <[email protected]>

Also applied. Thanks!
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt