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 /arch/powerpc/platforms/cell | |
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 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_epci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_pciex.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_manage.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c index 05b0db3ef638..844c0facb4f7 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c | |||
@@ -393,19 +393,19 @@ static int __init celleb_setup_epci(struct device_node *node, | |||
393 | 393 | ||
394 | if (of_address_to_resource(node, 0, &r)) | 394 | if (of_address_to_resource(node, 0, &r)) |
395 | goto error; | 395 | goto error; |
396 | hose->cfg_addr = ioremap(r.start, (r.end - r.start + 1)); | 396 | hose->cfg_addr = ioremap(r.start, resource_size(&r)); |
397 | if (!hose->cfg_addr) | 397 | if (!hose->cfg_addr) |
398 | goto error; | 398 | goto error; |
399 | pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n", | 399 | pr_debug("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n", |
400 | r.start, (unsigned long)hose->cfg_addr, (r.end - r.start + 1)); | 400 | r.start, (unsigned long)hose->cfg_addr, resource_size(&r)); |
401 | 401 | ||
402 | if (of_address_to_resource(node, 2, &r)) | 402 | if (of_address_to_resource(node, 2, &r)) |
403 | goto error; | 403 | goto error; |
404 | hose->cfg_data = ioremap(r.start, (r.end - r.start + 1)); | 404 | hose->cfg_data = ioremap(r.start, resource_size(&r)); |
405 | if (!hose->cfg_data) | 405 | if (!hose->cfg_data) |
406 | goto error; | 406 | goto error; |
407 | pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n", | 407 | pr_debug("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n", |
408 | r.start, (unsigned long)hose->cfg_data, (r.end - r.start + 1)); | 408 | r.start, (unsigned long)hose->cfg_data, resource_size(&r)); |
409 | 409 | ||
410 | hose->ops = &celleb_epci_ops; | 410 | hose->ops = &celleb_epci_ops; |
411 | celleb_epci_init(hose); | 411 | celleb_epci_init(hose); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index a881bbee8de0..ae790ac4a589 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c | |||
@@ -494,7 +494,7 @@ static __init int celleb_setup_pciex(struct device_node *node, | |||
494 | pr_err("PCIEXC:Failed to get config resource.\n"); | 494 | pr_err("PCIEXC:Failed to get config resource.\n"); |
495 | return 1; | 495 | return 1; |
496 | } | 496 | } |
497 | phb->cfg_addr = ioremap(r.start, r.end - r.start + 1); | 497 | phb->cfg_addr = ioremap(r.start, resource_size(&r)); |
498 | if (!phb->cfg_addr) { | 498 | if (!phb->cfg_addr) { |
499 | pr_err("PCIEXC:Failed to remap SMMIO region.\n"); | 499 | pr_err("PCIEXC:Failed to remap SMMIO region.\n"); |
500 | return 1; | 500 | return 1; |
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index f465d474ad9b..4e5c91489c02 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -222,7 +222,7 @@ static int spu_map_resource(struct spu *spu, int nr, | |||
222 | return ret; | 222 | return ret; |
223 | if (phys) | 223 | if (phys) |
224 | *phys = resource.start; | 224 | *phys = resource.start; |
225 | len = resource.end - resource.start + 1; | 225 | len = resource_size(&resource); |
226 | *virt = ioremap(resource.start, len); | 226 | *virt = ioremap(resource.start, len); |
227 | if (!*virt) | 227 | if (!*virt) |
228 | return -EINVAL; | 228 | return -EINVAL; |