* [patch] pxa168fb: use resource_size()
@ 2010-03-22 12:10 Dan Carpenter
2010-03-22 12:30 ` Eric Miao
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-22 12:10 UTC (permalink / raw)
To: Jun Nie
Cc: Eric Miao, Lennert Buytenhek, Krzysztof Helt, Kevin Liu,
linux-kernel, kernel-janitors
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] pxa168fb: use resource_size()
2010-03-22 12:10 [patch] pxa168fb: use resource_size() Dan Carpenter
@ 2010-03-22 12:30 ` Eric Miao
0 siblings, 0 replies; 2+ messages in thread
From: Eric Miao @ 2010-03-22 12:30 UTC (permalink / raw)
To: Dan Carpenter, Jun Nie, Eric Miao, Lennert Buytenhek,
Krzysztof Helt, Kevin Liu, linux-kernel, kernel-janitors
On Mon, Mar 22, 2010 at 8:10 PM, Dan Carpenter <error27@gmail.com> wrote:
> 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>
Applied to 'fix'.
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-22 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:10 [patch] pxa168fb: use resource_size() Dan Carpenter
2010-03-22 12:30 ` Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox