Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] Use kernel-supplied ARRAY_SIZE() macro.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Robert P. J. Day and committed by
Ralf Baechle
52f4f6bb 2957c9e6

+3 -3
+1 -1
arch/mips/mips-boards/malta/malta_int.c
··· 527 527 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE3 528 528 } 529 529 }; 530 - #define NIPI (sizeof(ipiirq)/sizeof(ipiirq[0])) 530 + #define NIPI ARRAY_SIZE(ipiirq) 531 531 fill_ipi_map(); 532 532 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); 533 533 if (!gcmp_present) {
+2 -2
arch/mips/sgi-ip22/ip28-berr.c
··· 412 412 * Now we have an asynchronous bus error, speculatively or DMA caused. 413 413 * Need to search all DMA descriptors for the error address. 414 414 */ 415 - for (i = 0; i < sizeof(hpc3)/sizeof(struct hpc3_stat); ++i) { 415 + for (i = 0; i < ARRAY_SIZE(hpc3); ++i) { 416 416 struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; 417 417 if ((cpu_err_stat & CPU_ERRMASK) && 418 418 (cpu_err_addr == hp->ndptr || cpu_err_addr == hp->cbp)) ··· 421 421 (gio_err_addr == hp->ndptr || gio_err_addr == hp->cbp)) 422 422 break; 423 423 } 424 - if (i < sizeof(hpc3)/sizeof(struct hpc3_stat)) { 424 + if (i < ARRAY_SIZE(hpc3)) { 425 425 struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; 426 426 printk(KERN_ERR "at DMA addresses: HPC3 @ %08lx:" 427 427 " ctl %08x, ndp %08x, cbp %08x\n",