]> err.no Git - linux-2.6/commitdiff
[MIPS] Use kernel-supplied ARRAY_SIZE() macro.
authorRobert P. J. Day <rpjday@crashcourse.ca>
Thu, 12 Jun 2008 19:20:05 +0000 (15:20 -0400)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 15 Jul 2008 17:44:30 +0000 (18:44 +0100)
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mips-boards/malta/malta_int.c
arch/mips/sgi-ip22/ip28-berr.c

index 8c495104b321c54078bee3dd18bfefc02f63eb05..4b5694e19d334159838dc608f129c2e0812d835f 100644 (file)
@@ -527,7 +527,7 @@ void __init arch_init_irq(void)
                                .call =  GIC_IPI_EXT_INTR_CALLFNC_VPE3
                        }
                };
-#define NIPI (sizeof(ipiirq)/sizeof(ipiirq[0]))
+#define NIPI ARRAY_SIZE(ipiirq)
                fill_ipi_map();
                gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
                if (!gcmp_present) {
index 30e12e2ec4b5a865bb78e436554ead389160f845..fee7a2e0e538b7d49c85f4df74b11152ccdd79f2 100644 (file)
@@ -412,7 +412,7 @@ static int ip28_be_interrupt(const struct pt_regs *regs)
         * Now we have an asynchronous bus error, speculatively or DMA caused.
         * Need to search all DMA descriptors for the error address.
         */
-       for (i = 0; i < sizeof(hpc3)/sizeof(struct hpc3_stat); ++i) {
+       for (i = 0; i < ARRAY_SIZE(hpc3); ++i) {
                struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i;
                if ((cpu_err_stat & CPU_ERRMASK) &&
                    (cpu_err_addr == hp->ndptr || cpu_err_addr == hp->cbp))
@@ -421,7 +421,7 @@ static int ip28_be_interrupt(const struct pt_regs *regs)
                    (gio_err_addr == hp->ndptr || gio_err_addr == hp->cbp))
                        break;
        }
-       if (i < sizeof(hpc3)/sizeof(struct hpc3_stat)) {
+       if (i < ARRAY_SIZE(hpc3)) {
                struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i;
                printk(KERN_ERR "at DMA addresses: HPC3 @ %08lx:"
                       " ctl %08x, ndp %08x, cbp %08x\n",