提交 fc22c357 编写于 作者: A Adrian Bunk 提交者: Ralf Baechle

[MIPS] mips/sgi-ip22/ip28-berr.c: fix the build

Commit 3e6ea3b0d7a93550a93a265e732413d3a5aaf0d2 (linux-mips.org) /
52f4f6bb (kernel.org)
([MIPS] Use kernel-supplied ARRAY_SIZE() macro.)
causes the following compile error:

<--  snip  -->

...
  CC      arch/mips/sgi-ip22/ip28-berr.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c: In function 'ip28_be_interrupt':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:415: error: subscripted value is neither array nor pointer
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:415: error: subscripted value is neither array nor pointer
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:415: warning: type defaults to 'int' in declaration of 'type name'
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:424: error: subscripted value is neither array nor pointer
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:424: error: subscripted value is neither array nor pointer
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/mips/sgi-ip22/ip28-berr.c:424: warning: type defaults to 'int' in declaration of 'type name'
make[2]: *** [arch/mips/sgi-ip22/ip28-berr.o] Error 1

<--  snip  -->

Using ARRAY_SIZE in these places in arch/mips/sgi-ip22/ip28-berr.c was
bogus, and therefore gets reverted by this patch.
Signed-off-by: NAdrian Bunk <bunk@kernel.org>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 8d795f2a
...@@ -412,7 +412,7 @@ static int ip28_be_interrupt(const struct pt_regs *regs) ...@@ -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. * Now we have an asynchronous bus error, speculatively or DMA caused.
* Need to search all DMA descriptors for the error address. * Need to search all DMA descriptors for the error address.
*/ */
for (i = 0; i < ARRAY_SIZE(hpc3); ++i) { for (i = 0; i < sizeof(hpc3)/sizeof(struct hpc3_stat); ++i) {
struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i;
if ((cpu_err_stat & CPU_ERRMASK) && if ((cpu_err_stat & CPU_ERRMASK) &&
(cpu_err_addr == hp->ndptr || cpu_err_addr == hp->cbp)) (cpu_err_addr == hp->ndptr || cpu_err_addr == hp->cbp))
...@@ -421,7 +421,7 @@ static int ip28_be_interrupt(const struct pt_regs *regs) ...@@ -421,7 +421,7 @@ static int ip28_be_interrupt(const struct pt_regs *regs)
(gio_err_addr == hp->ndptr || gio_err_addr == hp->cbp)) (gio_err_addr == hp->ndptr || gio_err_addr == hp->cbp))
break; break;
} }
if (i < ARRAY_SIZE(hpc3)) { if (i < sizeof(hpc3)/sizeof(struct hpc3_stat)) {
struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i;
printk(KERN_ERR "at DMA addresses: HPC3 @ %08lx:" printk(KERN_ERR "at DMA addresses: HPC3 @ %08lx:"
" ctl %08x, ndp %08x, cbp %08x\n", " ctl %08x, ndp %08x, cbp %08x\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册