edac: mpc85xx use resource_size instead of raw math
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 10 Mar 2010 23:23:13 +0000 (15:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Mar 2010 23:52:40 +0000 (15:52 -0800)
Use resource_size() instead of arithmetic.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Acked-by: Dave Jiang <djiang@mvista.com>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/edac/mpc85xx_edac.c

index 517042fafa78f06afbcc17afc57e96ef8a284965..94cac0aacea301babafb4abb3ef3cfad3170bae0 100644 (file)
@@ -239,16 +239,15 @@ static int __devinit mpc85xx_pci_err_probe(struct of_device *op,
        /* we only need the error registers */
        r.start += 0xe00;
 
-       if (!devm_request_mem_region(&op->dev, r.start,
-                                       r.end - r.start + 1, pdata->name)) {
+       if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
+                                       pdata->name)) {
                printk(KERN_ERR "%s: Error while requesting mem region\n",
                       __func__);
                res = -EBUSY;
                goto err;
        }
 
-       pdata->pci_vbase = devm_ioremap(&op->dev, r.start,
-                                       r.end - r.start + 1);
+       pdata->pci_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
        if (!pdata->pci_vbase) {
                printk(KERN_ERR "%s: Unable to setup PCI err regs\n", __func__);
                res = -ENOMEM;