From: Tobias Klauser <tklauser@distanz.ch>
To: jarkko.lavinen@nokia.com
Cc: tony@atomide.com, linux-omap@vger.kernel.org,
linux-mmc@vger.kernel.org, kernel-janitors@vger.kernel.org,
Tobias Klauser <tklauser@distanz.ch>
Subject: [PATCH] mmci-omap: Use resource_size
Date: Thu, 6 May 2010 10:04:19 +0200 [thread overview]
Message-ID: <1273133059-6335-1-git-send-email-tklauser@distanz.ch> (raw)
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
next reply other threads:[~2010-05-06 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 8:04 Tobias Klauser [this message]
2010-08-27 19:42 ` [PATCH] mmci-omap: Use resource_size Chris Ball
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273133059-6335-1-git-send-email-tklauser@distanz.ch \
--to=tklauser@distanz.ch \
--cc=jarkko.lavinen@nokia.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).