public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Jun Nie <njun@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>,
	Lennert Buytenhek <buytenh@marvell.com>,
	Krzysztof Helt <krzysztof.h1@wp.pl>,
	Kevin Liu <kliu5@marvell.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] pxa168fb: use resource_size()
Date: Mon, 22 Mar 2010 12:10:35 +0000	[thread overview]
Message-ID: <20100322121034.GI21571@bicker> (raw)

The size calculation is not correct.  It should be end - start + 1.
Use resource_size() to caculate it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This was found by a static checker and I don't have the hardware to
test it.  Please review carefully.

diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index 75285d3..c91a7f7 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -668,7 +668,7 @@ static int __init pxa168fb_probe(struct platform_device *pdev)
 	/*
 	 * Map LCD controller registers.
 	 */
-	fbi->reg_base = ioremap_nocache(res->start, res->end - res->start);
+	fbi->reg_base = ioremap_nocache(res->start, resource_size(res));
 	if (fbi->reg_base = NULL) {
 		ret = -ENOMEM;
 		goto failed;

             reply	other threads:[~2010-03-22 12:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 12:10 Dan Carpenter [this message]
2010-03-22 12:30 ` [patch] pxa168fb: use resource_size() Eric Miao

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=20100322121034.GI21571@bicker \
    --to=error27@gmail.com \
    --cc=buytenh@marvell.com \
    --cc=eric.y.miao@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kliu5@marvell.com \
    --cc=krzysztof.h1@wp.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=njun@marvell.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