]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
omap: Use resource_size
authorTobias Klauser <tklauser@distanz.ch>
Wed, 11 Nov 2009 02:55:19 +0000 (18:55 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 11 Nov 2009 02:55:19 +0000 (18:55 -0800)
Use the resource_size function instead of manually calculating the
resource size. This reduces the chance of introducing off-by-one errors
and actually fixes one in mailbox.c.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/mailbox.c

index 15876828db23b05abd24c4ab36eac7e6c9040a7d..f8657568b1baff51eeb6b950de4b35b6088d47c7 100644 (file)
@@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
        if (r < 0)
                goto out;
 
-       gpmc_cs_enable_mem(cs, res->start, res->end - res->start + 1);
+       gpmc_cs_enable_mem(cs, res->start, resource_size(res));
        *base = res->start;
        gpmc_cs_set_reserved(cs, 1);
 out:
index c035ad3426d0bf8998a9e981b2e327ab66da5ee7..ef57b38a56a483ee7598cc13835c78619ca7c53a 100644 (file)
@@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "invalid mem resource\n");
                return -ENODEV;
        }
-       mbox_base = ioremap(res->start, res->end - res->start);
+       mbox_base = ioremap(res->start, resource_size(res));
        if (!mbox_base)
                return -ENOMEM;