* [PATCH] mmci-omap: Use resource_size
@ 2010-05-06 8:04 Tobias Klauser
2010-08-27 19:42 ` Chris Ball
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2010-05-06 8:04 UTC (permalink / raw)
To: jarkko.lavinen
Cc: tony, linux-omap, linux-mmc, kernel-janitors, Tobias Klauser
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>
---
drivers/mmc/host/omap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 84d2804..a2c8545 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1415,7 +1415,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
if (res == NULL || irq < 0)
return -ENXIO;
- res = request_mem_region(res->start, res->end - res->start + 1,
+ res = request_mem_region(res->start, resource_size(res),
pdev->name);
if (res == NULL)
return -EBUSY;
@@ -1537,7 +1537,7 @@ static int mmc_omap_remove(struct platform_device *pdev)
iounmap(host->virt_base);
release_mem_region(pdev->resource[0].start,
- pdev->resource[0].end - pdev->resource[0].start + 1);
+ resource_size(&pdev->resource[0]));
kfree(host);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmci-omap: Use resource_size
2010-05-06 8:04 [PATCH] mmci-omap: Use resource_size Tobias Klauser
@ 2010-08-27 19:42 ` Chris Ball
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2010-08-27 19:42 UTC (permalink / raw)
To: Tobias Klauser
Cc: jarkko.lavinen, tony, linux-omap, linux-mmc, kernel-janitors,
akpm
Hi,
On Thu, May 06, 2010 at 10:04:19AM +0200, Tobias Klauser wrote:
> 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>
> ---
> drivers/mmc/host/omap.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> index 84d2804..a2c8545 100644
> --- a/drivers/mmc/host/omap.c
> +++ b/drivers/mmc/host/omap.c
> @@ -1415,7 +1415,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
> if (res == NULL || irq < 0)
> return -ENXIO;
>
> - res = request_mem_region(res->start, res->end - res->start + 1,
> + res = request_mem_region(res->start, resource_size(res),
> pdev->name);
> if (res == NULL)
> return -EBUSY;
> @@ -1537,7 +1537,7 @@ static int mmc_omap_remove(struct platform_device *pdev)
>
> iounmap(host->virt_base);
> release_mem_region(pdev->resource[0].start,
> - pdev->resource[0].end - pdev->resource[0].start + 1);
> + resource_size(&pdev->resource[0]));
>
> kfree(host);
>
> --
> 1.6.3.3
This wasn't picked up, and in the meantime the request_mem_region() call
has been converted over to use resource_size() but release_mem_region()
hasn't. Could someone pick up the second hunk?
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-27 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-06 8:04 [PATCH] mmci-omap: Use resource_size Tobias Klauser
2010-08-27 19:42 ` Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).