Use resource_size() for ioremap.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Alexander Clouter <[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;
On Thu, 2009-12-10 at 20:16 -0500, H Hartley Sweeten wrote:
> Use resource_size() for ioremap.
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Alexander Clouter <[email protected]>
(Generally speaking, it's best to cc: obscure stuff to a maintainer.)
Looks good to me. Herbert?
Signed-off-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;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
http://selenic.com : development and support for Mercurial and Linux
Hi,
* H Hartley Sweeten <[email protected]> [2009-12-10 20:16:54-0500]:
>
> Use resource_size() for ioremap.
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Alexander Clouter <[email protected]>
>
Acked-by: Alexander Clouter <[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;
--
Alexander Clouter
.sigmonster says: Every time I think I know where it's at, they move it.
On Thu, Dec 10, 2009 at 07:34:43PM -0600, Matt Mackall wrote:
> On Thu, 2009-12-10 at 20:16 -0500, H Hartley Sweeten wrote:
> > Use resource_size() for ioremap.
> >
> > Signed-off-by: H Hartley Sweeten <[email protected]>
> > Cc: Alexander Clouter <[email protected]>
>
> (Generally speaking, it's best to cc: obscure stuff to a maintainer.)
>
> Looks good to me. Herbert?
>
> Signed-off-by: Matt Mackall <[email protected]>
Patch applied. Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt