Re: 2.6.0-test4-mm5: SCSI imm driver doesn't compile

From: Arnaldo Carvalho de Melo
Date: Thu Sep 04 2003 - 08:32:56 EST


Em Wed, Sep 03, 2003 at 07:02:56PM +0200, Adrian Bunk escreveu:
> The following compile error (tested with gcc 2.95) seems to come from
> Linus' tree:
>
> <-- snip -->
>
> ...
> CC [M] drivers/scsi/imm.o
> In file included from drivers/scsi/imm.c:55:
> drivers/scsi/imm.h:105: duplicate array index in initializer
> drivers/scsi/imm.h:105: (near initialization for `IMM_MODE_STRING')
> make[2]: *** [drivers/scsi/imm.o] Error 1
>
> <-- snip -->
>
> The problem is the following code in imm.h (with
> CONFIG_SCSI_IZIP_EPP16 enabled):
>
> <-- snip -->
>
> ...
> static char *IMM_MODE_STRING[] =
> {
> [IMM_AUTODETECT] = "Autodetect",
> [IMM_NIBBLE] = "SPP",
> [IMM_PS2] = "PS/2",
> [IMM_EPP_8] = "EPP 8 bit",
> [IMM_EPP_16] = "EPP 16 bit",
> #ifdef CONFIG_SCSI_IZIP_EPP16
> [IMM_EPP_16] = "EPP 16 bit",
> #else
> [IMM_EPP_32] = "EPP 32 bit",
> #endif
> [IMM_UNKNOWN] = "Unknown",
> };
> ...
>
> <-- snip -->

Original code was:

static char *IMM_MODE_STRING[] =
{
"Autodetect",
"SPP",
"PS/2",
"EPP 8 bit",
"EPP 16 bit",
#ifdef CONFIG_SCSI_IZIP_EPP16
"EPP 16 bit",
#else
"EPP 32 bit",
#endif
"Unknown"};

I just converted it to the more safe c99 init style, but haven't noticed
the original bug, that is "EPP 16 bit" was duplicated... But this is already
fixed by Andrew Morton on current Linus bk tree.

Thanks Andrew for fixing, Adrian for noticing.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/