aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/ppc4xx_pci.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-09 12:13:32 -0400
committerJiri Kosina <jkosina@suse.cz>2011-06-10 08:55:36 -0400
commit28f65c11f2ffb3957259dece647a24f8ad2e241b (patch)
tree6b7621d09d10df89eedd908d4506fb9f457a909f /arch/powerpc/sysdev/ppc4xx_pci.c
parent140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (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/sysdev/ppc4xx_pci.c')
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 156aa7d36258..deda60a7f996 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -265,7 +265,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
265 if (ppc4xx_setup_one_pci_PMM(hose, reg, 265 if (ppc4xx_setup_one_pci_PMM(hose, reg,
266 res->start, 266 res->start,
267 res->start - hose->pci_mem_offset, 267 res->start - hose->pci_mem_offset,
268 res->end + 1 - res->start, 268 resource_size(res),
269 res->flags, 269 res->flags,
270 j) == 0) { 270 j) == 0) {
271 j++; 271 j++;
@@ -290,7 +290,7 @@ static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
290 void __iomem *reg, 290 void __iomem *reg,
291 const struct resource *res) 291 const struct resource *res)
292{ 292{
293 resource_size_t size = res->end - res->start + 1; 293 resource_size_t size = resource_size(res);
294 u32 sa; 294 u32 sa;
295 295
296 /* Calculate window size */ 296 /* Calculate window size */
@@ -349,7 +349,7 @@ static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
349 bus_range = of_get_property(np, "bus-range", NULL); 349 bus_range = of_get_property(np, "bus-range", NULL);
350 350
351 /* Map registers */ 351 /* Map registers */
352 reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start); 352 reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg));
353 if (reg == NULL) { 353 if (reg == NULL) {
354 printk(KERN_ERR "%s: Can't map registers !", np->full_name); 354 printk(KERN_ERR "%s: Can't map registers !", np->full_name);
355 goto fail; 355 goto fail;
@@ -465,7 +465,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose,
465 if (ppc4xx_setup_one_pcix_POM(hose, reg, 465 if (ppc4xx_setup_one_pcix_POM(hose, reg,
466 res->start, 466 res->start,
467 res->start - hose->pci_mem_offset, 467 res->start - hose->pci_mem_offset,
468 res->end + 1 - res->start, 468 resource_size(res),
469 res->flags, 469 res->flags,
470 j) == 0) { 470 j) == 0) {
471 j++; 471 j++;
@@ -492,7 +492,7 @@ static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose,
492 int big_pim, 492 int big_pim,
493 int enable_msi_hole) 493 int enable_msi_hole)
494{ 494{
495 resource_size_t size = res->end - res->start + 1; 495 resource_size_t size = resource_size(res);
496 u32 sa; 496 u32 sa;
497 497
498 /* RAM is always at 0 */ 498 /* RAM is always at 0 */
@@ -555,7 +555,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
555 bus_range = of_get_property(np, "bus-range", NULL); 555 bus_range = of_get_property(np, "bus-range", NULL);
556 556
557 /* Map registers */ 557 /* Map registers */
558 reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start); 558 reg = ioremap(rsrc_reg.start, resource_size(&rsrc_reg));
559 if (reg == NULL) { 559 if (reg == NULL) {
560 printk(KERN_ERR "%s: Can't map registers !", np->full_name); 560 printk(KERN_ERR "%s: Can't map registers !", np->full_name);
561 goto fail; 561 goto fail;
@@ -1604,7 +1604,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port,
1604 if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, 1604 if (ppc4xx_setup_one_pciex_POM(port, hose, mbase,
1605 res->start, 1605 res->start,
1606 res->start - hose->pci_mem_offset, 1606 res->start - hose->pci_mem_offset,
1607 res->end + 1 - res->start, 1607 resource_size(res),
1608 res->flags, 1608 res->flags,
1609 j) == 0) { 1609 j) == 0) {
1610 j++; 1610 j++;
@@ -1639,7 +1639,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1639 void __iomem *mbase, 1639 void __iomem *mbase,
1640 struct resource *res) 1640 struct resource *res)
1641{ 1641{
1642 resource_size_t size = res->end - res->start + 1; 1642 resource_size_t size = resource_size(res);
1643 u64 sa; 1643 u64 sa;
1644 1644
1645 if (port->endpoint) { 1645 if (port->endpoint) {