2009-12-11 16:52:36

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] mpc85xx_edac.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Doug Thompson <[email protected]>
Cc: Dave Jiang <[email protected]>

---

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index cf27402..adecf37 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;


2009-12-11 16:58:23

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH] mpc85xx_edac.c: use resource_size()

Acked-by: Dave Jiang <[email protected]>

On 12/11/2009 09:52 AM, H Hartley Sweeten wrote:
> Use resource_size().
>
> Signed-off-by: H Hartley Sweeten<[email protected]>
> Cc: Doug Thompson<[email protected]>
> Cc: Dave Jiang<[email protected]>
>
> ---
>
> diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
> index cf27402..adecf37 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;