diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-24 08:52:22 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-01 08:18:53 +0200 |
commit | 5f03074ea98b64b55c133b35ee144fdc909e6d69 (patch) | |
tree | 1a61fd84a5a44d98297014486eca663221ff4cbc /drivers/video | |
parent | 20addb80f65076b3a81c7d778f7b93d445a96841 (diff) | |
download | barebox-5f03074ea98b64b55c133b35ee144fdc909e6d69.tar.gz barebox-5f03074ea98b64b55c133b35ee144fdc909e6d69.tar.xz |
resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 0be465f892..d885570b24 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -86,7 +86,7 @@ static int fb_setup_mode(struct device_d *dev, struct param_d *param, if (!ret) { dev->resource[0].start = (resource_size_t)info->screen_base; info->cdev.size = info->xres * info->yres * (info->bits_per_pixel >> 3); - dev->resource[0].size = info->cdev.size; + dev->resource[0].end = info->cdev.size - 1; dev_param_set_generic(dev, param, val); } else info->cdev.size = 0; @@ -116,7 +116,7 @@ int register_framebuffer(struct fb_info *info) info->cdev.priv = info; dev->resource = xzalloc(sizeof(struct resource)); dev->resource[0].start = (resource_size_t)info->screen_base; - dev->resource[0].size = info->cdev.size; + dev->resource[0].end = info->cdev.size - 1; dev->resource[0].flags = IORESOURCE_MEM; dev->num_resources = 1; |