Fix compilation with CONFIG_MELAN
PATCH 1/1 Fix compilation with CONFIG_MELAN
This patch fixes compilation when CONFIG_MELAN is turned on. The problem is that <asm-i386/mach-default/mach_resources.h> includes the bogus construction
#ifdef CONFIG_MELAN
standard_io_resources[1] = { "pic1", 0x20, 0x21, IORESOURCE_BUSY }; standard_io_resources[5] = { "pic2", 0xa0, 0xa1, IORESOURCE_BUSY }; #endif
at the top level. I tried this with Debian's gcc 2.95 and Red Hat's gcc 3.2, and neither will accept it (they complain about a duplicate declaration of standard_io_resources when building arch/i386/setup.c).
To duplicate this, you can do "make defconfig" and then go into "make menuconfig" and change "Processor family" to "Elan". Building that config fails for me.
I assume the following is what was intended.
- Roland
===== include/asm-i386/mach-default/mach_resources.h 1.1 vs edited =====
include/asm-i386/mach-default/mach_resources.h +8 -4
@@ -9,18 +9,22 @@struct resource standard_io_resources[] = { {"dma1" ,0x00 ,0x1f ,IORESOURCE_BUSY }, +#ifndef CONFIG_MELAN {"pic1" ,0x20 ,0x3f ,IORESOURCE_BUSY }, +#else + {"pic1" ,0x20 ,0x21 ,IORESOURCE_BUSY }, +#endif {"timer" ,0x40 ,0x5f ,IORESOURCE_BUSY }, {"keyboard" ,0x60 ,0x6f ,IORESOURCE_BUSY }, {"dma page reg" ,0x80 ,0x8f ,IORESOURCE_BUSY }, +#ifndef CONFIG_MELAN {"pic2" ,0xa0 ,0xbf ,IORESOURCE_BUSY }, +#else + {"pic2" ,0xa0 ,0xa1 ,IORESOURCE_BUSY }, +#endif {"dma2" ,0xc0 ,0xdf ,IORESOURCE_BUSY }, {"fpu" ,0xf0 ,0xff ,IORESOURCE_BUSY } }; -#ifdef CONFIG_MELAN -standard_io_resources[1] = { "pic1", 0x20, 0x21, IORESOURCE_BUSY }; -standard_io_resources[5] = { "pic2", 0xa0, 0xa1, IORESOURCE_BUSY }; -#endif #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))