aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-10-04 11:26:24 -0400
committerPaul Mackerras <paulus@samba.org>2006-10-04 19:21:02 -0400
commit43b4f4061cf54aa225a1e94a969450ccf5305cd9 (patch)
treecef8ed4fe2ca1019509e585bf4dcaab04236bcaf
parentf7e2ce788677ca0996d360202b91524db894c7b2 (diff)
[POWERPC] cell: fix bugs found by sparse
- Some long constants should be marked 'ul'. - When using desc->handler_data to pass an __iomem register area, we need to add casts to and from __iomem. Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c10
-rw-r--r--arch/powerpc/platforms/cell/iommu.c8
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c2
3 files changed, 12 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 6cc59e0b4582..8533f13a5ed1 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -101,7 +101,7 @@ static void iic_ioexc_eoi(unsigned int irq)
101static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc, 101static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc,
102 struct pt_regs *regs) 102 struct pt_regs *regs)
103{ 103{
104 struct cbe_iic_regs *node_iic = desc->handler_data; 104 struct cbe_iic_regs __iomem *node_iic = (void __iomem *)desc->handler_data;
105 unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC; 105 unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC;
106 unsigned long bits, ack; 106 unsigned long bits, ack;
107 int cascade; 107 int cascade;
@@ -320,7 +320,7 @@ static int __init setup_iic(void)
320 struct device_node *dn; 320 struct device_node *dn;
321 struct resource r0, r1; 321 struct resource r0, r1;
322 unsigned int node, cascade, found = 0; 322 unsigned int node, cascade, found = 0;
323 struct cbe_iic_regs *node_iic; 323 struct cbe_iic_regs __iomem *node_iic;
324 const u32 *np; 324 const u32 *np;
325 325
326 for (dn = NULL; 326 for (dn = NULL;
@@ -357,7 +357,11 @@ static int __init setup_iic(void)
357 cascade = irq_create_mapping(iic_host, cascade); 357 cascade = irq_create_mapping(iic_host, cascade);
358 if (cascade == NO_IRQ) 358 if (cascade == NO_IRQ)
359 continue; 359 continue;
360 set_irq_data(cascade, node_iic); 360 /*
361 * irq_data is a generic pointer that gets passed back
362 * to us later, so the forced cast is fine.
363 */
364 set_irq_data(cascade, (void __force *)node_iic);
361 set_irq_chained_handler(cascade , iic_ioexc_cascade); 365 set_irq_chained_handler(cascade , iic_ioexc_cascade);
362 out_be64(&node_iic->iic_ir, 366 out_be64(&node_iic->iic_ir,
363 (1 << 12) /* priority */ | 367 (1 << 12) /* priority */ |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index d2b20eba5b87..aca4c3db0dde 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -345,8 +345,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
345 345
346 /* node 0 */ 346 /* node 0 */
347 iommu = &cell_iommus[0]; 347 iommu = &cell_iommus[0];
348 iommu->mapped_base = ioremap(0x20000511000, 0x1000); 348 iommu->mapped_base = ioremap(0x20000511000ul, 0x1000);
349 iommu->mapped_mmio_base = ioremap(0x20000510000, 0x1000); 349 iommu->mapped_mmio_base = ioremap(0x20000510000ul, 0x1000);
350 350
351 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base); 351 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
352 352
@@ -358,8 +358,8 @@ static int cell_map_iommu_hardcoded(int num_nodes)
358 358
359 /* node 1 */ 359 /* node 1 */
360 iommu = &cell_iommus[1]; 360 iommu = &cell_iommus[1];
361 iommu->mapped_base = ioremap(0x30000511000, 0x1000); 361 iommu->mapped_base = ioremap(0x30000511000ul, 0x1000);
362 iommu->mapped_mmio_base = ioremap(0x30000510000, 0x1000); 362 iommu->mapped_mmio_base = ioremap(0x30000510000ul, 0x1000);
363 363
364 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base); 364 enable_mapping(iommu->mapped_base, iommu->mapped_mmio_base);
365 365
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 6794de0cc0f0..b0e95d594c51 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -367,7 +367,7 @@ void __init spider_init_IRQ(void)
367 } else if (device_is_compatible(dn, "sti,platform-spider-pic") 367 } else if (device_is_compatible(dn, "sti,platform-spider-pic")
368 && (chip < 2)) { 368 && (chip < 2)) {
369 static long hard_coded_pics[] = 369 static long hard_coded_pics[] =
370 { 0x24000008000, 0x34000008000 }; 370 { 0x24000008000ul, 0x34000008000ul};
371 r.start = hard_coded_pics[chip]; 371 r.start = hard_coded_pics[chip];
372 } else 372 } else
373 continue; 373 continue;