diff options
author | Joe Perches <joe@perches.com> | 2011-06-09 12:13:32 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-06-10 08:55:36 -0400 |
commit | 28f65c11f2ffb3957259dece647a24f8ad2e241b (patch) | |
tree | 6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/edac | |
parent | 140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff) |
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing.
Done via coccinelle scripts like:
@@
struct resource *ptr;
@@
- ptr->end - ptr->start + 1
+ resource_size(ptr)
and some grep and typing.
Mostly uncompiled, no cross-compilers.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/cell_edac.c | 2 | ||||
-rw-r--r-- | drivers/edac/mpc85xx_edac.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c index db1df59ae2b6..9a6a274e6925 100644 --- a/drivers/edac/cell_edac.c +++ b/drivers/edac/cell_edac.c | |||
@@ -140,7 +140,7 @@ static void __devinit cell_edac_init_csrows(struct mem_ctl_info *mci) | |||
140 | if (of_node_to_nid(np) != priv->node) | 140 | if (of_node_to_nid(np) != priv->node) |
141 | continue; | 141 | continue; |
142 | csrow->first_page = r.start >> PAGE_SHIFT; | 142 | csrow->first_page = r.start >> PAGE_SHIFT; |
143 | csrow->nr_pages = (r.end - r.start + 1) >> PAGE_SHIFT; | 143 | csrow->nr_pages = resource_size(&r) >> PAGE_SHIFT; |
144 | csrow->last_page = csrow->first_page + csrow->nr_pages - 1; | 144 | csrow->last_page = csrow->first_page + csrow->nr_pages - 1; |
145 | csrow->mtype = MEM_XDR; | 145 | csrow->mtype = MEM_XDR; |
146 | csrow->edac_mode = EDAC_SECDED; | 146 | csrow->edac_mode = EDAC_SECDED; |
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 38ab8e2cd7f4..11e1a5dad96f 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c | |||
@@ -538,15 +538,15 @@ static int __devinit mpc85xx_l2_err_probe(struct platform_device *op) | |||
538 | /* we only need the error registers */ | 538 | /* we only need the error registers */ |
539 | r.start += 0xe00; | 539 | r.start += 0xe00; |
540 | 540 | ||
541 | if (!devm_request_mem_region(&op->dev, r.start, | 541 | if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), |
542 | r.end - r.start + 1, pdata->name)) { | 542 | pdata->name)) { |
543 | printk(KERN_ERR "%s: Error while requesting mem region\n", | 543 | printk(KERN_ERR "%s: Error while requesting mem region\n", |
544 | __func__); | 544 | __func__); |
545 | res = -EBUSY; | 545 | res = -EBUSY; |
546 | goto err; | 546 | goto err; |
547 | } | 547 | } |
548 | 548 | ||
549 | pdata->l2_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1); | 549 | pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); |
550 | if (!pdata->l2_vbase) { | 550 | if (!pdata->l2_vbase) { |
551 | printk(KERN_ERR "%s: Unable to setup L2 err regs\n", __func__); | 551 | printk(KERN_ERR "%s: Unable to setup L2 err regs\n", __func__); |
552 | res = -ENOMEM; | 552 | res = -ENOMEM; |
@@ -987,15 +987,15 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op) | |||
987 | goto err; | 987 | goto err; |
988 | } | 988 | } |
989 | 989 | ||
990 | if (!devm_request_mem_region(&op->dev, r.start, | 990 | if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), |
991 | r.end - r.start + 1, pdata->name)) { | 991 | pdata->name)) { |
992 | printk(KERN_ERR "%s: Error while requesting mem region\n", | 992 | printk(KERN_ERR "%s: Error while requesting mem region\n", |
993 | __func__); | 993 | __func__); |
994 | res = -EBUSY; | 994 | res = -EBUSY; |
995 | goto err; | 995 | goto err; |
996 | } | 996 | } |
997 | 997 | ||
998 | pdata->mc_vbase = devm_ioremap(&op->dev, r.start, r.end - r.start + 1); | 998 | pdata->mc_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); |
999 | if (!pdata->mc_vbase) { | 999 | if (!pdata->mc_vbase) { |
1000 | printk(KERN_ERR "%s: Unable to setup MC err regs\n", __func__); | 1000 | printk(KERN_ERR "%s: Unable to setup MC err regs\n", __func__); |
1001 | res = -ENOMEM; | 1001 | res = -ENOMEM; |