Re: [2.6 patch] mips/sgi-ip22/ip28-berr.c: fix the build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 16 Jul 2008, Adrian Bunk wrote:

> Commit 52f4f6bbcff5510f662a002ec1219660ea25af62
> ([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: Adrian Bunk <bunk@xxxxxxxxxx>
>
> ---
>
>  arch/mips/sgi-ip22/ip28-berr.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/arch/mips/sgi-ip22/ip28-berr.c
> +++ b/arch/mips/sgi-ip22/ip28-berr.c
> @@ -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 < ARRAY_SIZE(hpc3); ++i) {
> +	for (i = 0; i < sizeof(hpc3)/sizeof(struct hpc3_stat); ++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 < ARRAY_SIZE(hpc3)) {
> +	if (i < sizeof(hpc3)/sizeof(struct hpc3_stat)) {
>  		struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i;
>  		printk(KERN_ERR "at DMA addresses: HPC3 @ %08lx:"
>  		       " ctl %08x, ndp %08x, cbp %08x\n",

quite right, that was a really dumb transformation.  my bad.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux