Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Adrian Bunk <bunk@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [2.6 patch] mips/sgi-ip22/ip28-berr.c: fix the build
Date: Wed, 16 Jul 2008 12:31:15 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0807161230360.12718@localhost.localdomain> (raw)
In-Reply-To: <20080716162540.GB17329@cs181140183.pp.htv.fi>

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@kernel.org>
>
> ---
>
>  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
========================================================================

  reply	other threads:[~2008-07-16 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 16:25 [2.6 patch] mips/sgi-ip22/ip28-berr.c: fix the build Adrian Bunk
2008-07-16 16:31 ` Robert P. J. Day [this message]
2008-07-18 14:46 ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0807161230360.12718@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=bunk@kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox