From: H Hartley Sweeten Date: Wed, 10 Mar 2010 23:23:13 +0000 (-0800) Subject: edac: mpc85xx use resource_size instead of raw math X-Git-Tag: v2.6.34-rc2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66ed3f7516da31205aed9b47a13348c0d982c4f5;p=platform%2Fkernel%2Flinux-3.10.git edac: mpc85xx use resource_size instead of raw math Use resource_size() instead of arithmetic. Signed-off-by: H Hartley Sweeten Signed-off-by: Doug Thompson Acked-by: Dave Jiang Cc: Peter Tyser Cc: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 517042f..94cac0a 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -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;