[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1296293628.13797.2.camel@phoenix>
Date: Sat, 29 Jan 2011 17:33:48 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Phil Blundell <philb@....org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Paul Mundt <lethal@...ux-sh.org>, linux-fbdev@...r.kernel.org
Subject: [PATCH 1/2] video: hpfb: use resource_size()
The size calculation is done incorrectly here because it should include
both the start and end (end - start + 1).
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
drivers/video/hpfb.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index c8e280f..ebf8495 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -321,11 +321,11 @@ static int __devinit hpfb_dio_probe(struct dio_dev * d, const struct dio_device_
unsigned long paddr, vaddr;
paddr = d->resource.start;
- if (!request_mem_region(d->resource.start, d->resource.end - d->resource.start, d->name))
+ if (!request_mem_region(d->resource.start, resource_size(&d->resource), d->name))
return -EBUSY;
if (d->scode >= DIOII_SCBASE) {
- vaddr = (unsigned long)ioremap(paddr, d->resource.end - d->resource.start);
+ vaddr = (unsigned long)ioremap(paddr, resource_size(&d->resource));
} else {
vaddr = paddr + DIO_VIRADDRBASE;
}
@@ -344,7 +344,7 @@ static void __devexit hpfb_remove_one(struct dio_dev *d)
unregister_framebuffer(&fb_info);
if (d->scode >= DIOII_SCBASE)
iounmap((void *)fb_regs);
- release_mem_region(d->resource.start, d->resource.end - d->resource.start);
+ release_mem_region(d->resource.start, resource_size(&d->resource));
}
static struct dio_device_id hpfb_dio_tbl[] = {
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists