Re: SM501: Fix missing uses of resource_size()

From: Andres Salomon
Date: Tue Nov 10 2009 - 13:16:22 EST


On Tue, 10 Nov 2009 17:17:34 +0000
Ben Dooks <ben@xxxxxxxxxxxx> wrote:

> There are several places in the SM501 fb driver that could do with
> using resource_size() to calculate the size of a resource.
>

Yes, please! Also, as Thiago suggested, please submit this inline.

[...]
> @@ -1363,7 +1363,7 @@ static int sm501fb_start(struct sm501fb_
> }
>
> info->fbmem_res = request_mem_region(res->start,
> - (res->end -
> res->start)+1,
> + resource_size(res),
> pdev->name);
> if (info->fbmem_res == NULL) {
> dev_err(dev, "cannot claim framebuffer\n");
> @@ -1377,7 +1377,7 @@ static int sm501fb_start(struct sm501fb_

Looks like you missed one here; the ioremap on line 1374 should also
use resource_size.


> goto err_mem_res;
> }
>
> - info->fbmem_len = (res->end - res->start)+1;
> + info->fbmem_len = resource_size(res);
>
> /* clear framebuffer memory - avoids garbage data on unused
> fb */ memset(info->fbmem, 0, info->fbmem_len);
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/