The sh systemh_defconfig currently fails to build with the following
error:
<-- snip -->
...
CC arch/sh/boards/renesas/systemh/irq.o
In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/boards/renesas/systemh/irq.c:16:
/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/ide.h:645: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function)
make[2]: *** [arch/sh/boards/renesas/systemh/irq.o] Error 1
<-- snip -->
Considering the little benefits of all this fiddling with IDE_MAX_HWIFS
I decided to fix it through a simplification:
- always #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
- always set CONFIG_IDE_MAX_HWIFS in kconfig
- let IDE_MAX_HWIFS default to 10
- allow changing the value of IDE_MAX_HWIFS only if IDE && EMBEDDED
Reported-by: Adrian Bunk <[email protected]>
Signed-off-by: Adrian Bunk <[email protected]>
---
drivers/ide/Kconfig | 9 ++++-----
include/linux/ide.h | 11 -----------
2 files changed, 4 insertions(+), 16 deletions(-)
fd8ca9d5fefc48c04caa910adb753924454d9cfc
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 130ef64..174b627 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -52,18 +52,17 @@ menuconfig IDE
If unsure, say Y.
-if IDE
-
config IDE_MAX_HWIFS
- int "Max IDE interfaces"
- depends on ALPHA || SUPERH || IA64 || EMBEDDED
+ int "Max IDE interfaces" if IDE && EMBEDDED
range 1 10
- default 4
+ default 10
help
This is the maximum number of IDE hardware interfaces that will
be supported by the driver. Make sure it is at least as high as
the number of IDE interfaces in your system.
+if IDE
+
config BLK_DEV_IDE
tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"
---help---
diff --git a/include/linux/ide.h b/include/linux/ide.h
index b846bc4..b5b84fe 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -219,18 +219,7 @@ static inline int __ide_default_irq(unsigned long base)
#include <asm-generic/ide_iops.h>
#endif
-#ifndef MAX_HWIFS
-#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA)
-# define MAX_HWIFS 1
-#else
-# define MAX_HWIFS 10
-#endif
-#endif
-
-#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
-#undef MAX_HWIFS
#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
-#endif
/* Currently only m68k, apus and m8xx need it */
#ifndef IDE_ARCH_ACK_INTR
On Sunday 27 July 2008, Adrian Bunk wrote:
> The sh systemh_defconfig currently fails to build with the following
> error:
>
> <-- snip -->
>
> ...
> CC arch/sh/boards/renesas/systemh/irq.o
> In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/boards/renesas/systemh/irq.c:16:
> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/ide.h:645: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function)
> make[2]: *** [arch/sh/boards/renesas/systemh/irq.o] Error 1
Please also fix the source root of the problem:
arch/sh/boards/renesas/systemh/irq.c should have no bussiness in
including include/linux/ide.h (which is for drivers/ide/ _only_)
> <-- snip -->
>
> Considering the little benefits of all this fiddling with IDE_MAX_HWIFS
> I decided to fix it through a simplification:
> - always #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
> - always set CONFIG_IDE_MAX_HWIFS in kconfig
> - let IDE_MAX_HWIFS default to 10
> - allow changing the value of IDE_MAX_HWIFS only if IDE && EMBEDDED
I was actually wondering whether it is worth to keep IDE_MAX_HWIFS
now that ide_hwif_t instances are allocated dynamically.
[ The difference between MAX_HWIFS == 10 and MAX_HWIFS == 2 is now
~100 bytes (x86_32) and between MAX_HWIFS == 10 and MAX_HWIFS == 1
it is ~1kb (IIRC). ]
Since there were also many other improvements in shrinking drivers/ide/
code size which should keep embedded users happy and compensate for
the above 1kB-worst-case I would prefer to have IDE_MAX_HWIFS removed
completely.
> Reported-by: Adrian Bunk <[email protected]>
> Signed-off-by: Adrian Bunk <[email protected]>
>
> ---
>
> drivers/ide/Kconfig | 9 ++++-----
> include/linux/ide.h | 11 -----------
> 2 files changed, 4 insertions(+), 16 deletions(-)
>
> fd8ca9d5fefc48c04caa910adb753924454d9cfc
> diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
> index 130ef64..174b627 100644
> --- a/drivers/ide/Kconfig
> +++ b/drivers/ide/Kconfig
> @@ -52,18 +52,17 @@ menuconfig IDE
>
> If unsure, say Y.
>
> -if IDE
> -
> config IDE_MAX_HWIFS
> - int "Max IDE interfaces"
> - depends on ALPHA || SUPERH || IA64 || EMBEDDED
> + int "Max IDE interfaces" if IDE && EMBEDDED
> range 1 10
> - default 4
> + default 10
> help
> This is the maximum number of IDE hardware interfaces that will
> be supported by the driver. Make sure it is at least as high as
> the number of IDE interfaces in your system.
>
> +if IDE
> +
> config BLK_DEV_IDE
> tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"
> ---help---
> diff --git a/include/linux/ide.h b/include/linux/ide.h
> index b846bc4..b5b84fe 100644
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -219,18 +219,7 @@ static inline int __ide_default_irq(unsigned long base)
> #include <asm-generic/ide_iops.h>
> #endif
>
> -#ifndef MAX_HWIFS
> -#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA)
> -# define MAX_HWIFS 1
> -#else
> -# define MAX_HWIFS 10
> -#endif
> -#endif
> -
> -#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
> -#undef MAX_HWIFS
> #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
> -#endif
>
> /* Currently only m68k, apus and m8xx need it */
> #ifndef IDE_ARCH_ACK_INTR
On Sun, Jul 27, 2008 at 04:32:16PM +0200, Bartlomiej Zolnierkiewicz wrote:
> On Sunday 27 July 2008, Adrian Bunk wrote:
>...
> > <-- snip -->
> >
> > Considering the little benefits of all this fiddling with IDE_MAX_HWIFS
> > I decided to fix it through a simplification:
> > - always #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
> > - always set CONFIG_IDE_MAX_HWIFS in kconfig
> > - let IDE_MAX_HWIFS default to 10
> > - allow changing the value of IDE_MAX_HWIFS only if IDE && EMBEDDED
>
> I was actually wondering whether it is worth to keep IDE_MAX_HWIFS
> now that ide_hwif_t instances are allocated dynamically.
>
> [ The difference between MAX_HWIFS == 10 and MAX_HWIFS == 2 is now
> ~100 bytes (x86_32) and between MAX_HWIFS == 10 and MAX_HWIFS == 1
> it is ~1kb (IIRC). ]
>
> Since there were also many other improvements in shrinking drivers/ide/
> code size which should keep embedded users happy and compensate for
> the above 1kB-worst-case I would prefer to have IDE_MAX_HWIFS removed
> completely.
>...
Patch below.
cu
Adrian
<-- snip -->
The benefits of a user settable CONFIG_IDE_MAX_HWIFS have become pretty
tiny and are no longer considered worth the trouble of an own option.
Simply always #define MAX_HWIFS to 10.
Signed-off-by: Adrian Bunk <[email protected]>
---
drivers/ide/Kconfig | 10 ----------
include/linux/ide.h | 13 +------------
2 files changed, 1 insertion(+), 22 deletions(-)
f09c0c4e445dff712ad883c173e4da02ce943e5d
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 130ef64..a34758d 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -54,16 +54,6 @@ menuconfig IDE
if IDE
-config IDE_MAX_HWIFS
- int "Max IDE interfaces"
- depends on ALPHA || SUPERH || IA64 || EMBEDDED
- range 1 10
- default 4
- help
- This is the maximum number of IDE hardware interfaces that will
- be supported by the driver. Make sure it is at least as high as
- the number of IDE interfaces in your system.
-
config BLK_DEV_IDE
tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"
---help---
diff --git a/include/linux/ide.h b/include/linux/ide.h
index b846bc4..1347c82 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -219,18 +219,7 @@ static inline int __ide_default_irq(unsigned long base)
#include <asm-generic/ide_iops.h>
#endif
-#ifndef MAX_HWIFS
-#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA)
-# define MAX_HWIFS 1
-#else
-# define MAX_HWIFS 10
-#endif
-#endif
-
-#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
-#undef MAX_HWIFS
-#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
-#endif
+#define MAX_HWIFS 10
/* Currently only m68k, apus and m8xx need it */
#ifndef IDE_ARCH_ACK_INTR
On Sun, Jul 27, 2008 at 04:32:16PM +0200, Bartlomiej Zolnierkiewicz wrote:
> On Sunday 27 July 2008, Adrian Bunk wrote:
> > The sh systemh_defconfig currently fails to build with the following
> > error:
> >
> > <-- snip -->
> >
> > ...
> > CC arch/sh/boards/renesas/systemh/irq.o
> > In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/boards/renesas/systemh/irq.c:16:
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/ide.h:645: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function)
> > make[2]: *** [arch/sh/boards/renesas/systemh/irq.o] Error 1
>
> Please also fix the source root of the problem:
>
> arch/sh/boards/renesas/systemh/irq.c should have no bussiness in
> including include/linux/ide.h (which is for drivers/ide/ _only_)
>...
ide-scsi.c and the mediabay stuff might qualify as exceptions?
For the rest a patch is below (on top of your #include <linux/hdreg.h>
removal patch).
cu
Adrian
<-- snip -->
This patch remove unneeded #include <linux/ide.h>'s.
It also adds a required #include <linux/interrupt.h> that was previously
implicitely pulled by ide.h
Signed-off-by: Adrian Bunk <[email protected]>
---
arch/arm/mach-pxa/pcm990-baseboard.c | 1 -
arch/m68k/mac/baboon.c | 1 -
arch/m68k/mac/via.c | 1 -
arch/mips/emma2rh/markeins/setup.c | 1 -
arch/mips/jazz/setup.c | 1 -
arch/sh/boards/renesas/systemh/irq.c | 2 +-
arch/xtensa/kernel/xtensa_ksyms.c | 1 -
drivers/misc/lkdtm.c | 4 ----
8 files changed, 1 insertion(+), 11 deletions(-)
5d4186cd22d575b6adbbeeee7dfa88299817a408
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 30023b0..90056d5 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -22,7 +22,6 @@
#include <linux/irq.h>
#include <linux/platform_device.h>
-#include <linux/ide.h>
#include <linux/i2c.h>
#include <linux/pwm_backlight.h>
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index dae9c98..c7b25b0 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -11,7 +11,6 @@
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/init.h>
-#include <linux/ide.h>
#include <asm/traps.h>
#include <asm/bootinfo.h>
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index f3b27d0..1bdb03c 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -27,7 +27,6 @@
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/init.h>
-#include <linux/ide.h>
#include <linux/module.h>
#include <asm/bootinfo.h>
diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c
index 62bfb45..65d06d5 100644
--- a/arch/mips/emma2rh/markeins/setup.c
+++ b/arch/mips/emma2rh/markeins/setup.c
@@ -27,7 +27,6 @@
#include <linux/types.h>
#include <linux/initrd.h>
#include <linux/irq.h>
-#include <linux/ide.h>
#include <linux/ioport.h>
#include <linux/param.h> /* for HZ */
#include <linux/root_dev.h>
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index d3a531a..b59ba6b 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -17,7 +17,6 @@
#include <linux/mm.h>
#include <linux/console.h>
#include <linux/fb.h>
-#include <linux/ide.h>
#include <linux/pm.h>
#include <linux/screen_info.h>
#include <linux/platform_device.h>
diff --git a/arch/sh/boards/renesas/systemh/irq.c b/arch/sh/boards/renesas/systemh/irq.c
index 82101cc..601c9c8 100644
--- a/arch/sh/boards/renesas/systemh/irq.c
+++ b/arch/sh/boards/renesas/systemh/irq.c
@@ -11,8 +11,8 @@
#include <linux/init.h>
#include <linux/irq.h>
+#include <linux/interrupt.h>
-#include <linux/ide.h>
#include <asm/io.h>
#include <asm/systemh7751.h>
#include <asm/smc37c93x.h>
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c
index 6e52cdd..c9a7c5b 100644
--- a/arch/xtensa/kernel/xtensa_ksyms.c
+++ b/arch/xtensa/kernel/xtensa_ksyms.c
@@ -18,7 +18,6 @@
#include <linux/interrupt.h>
#include <asm/irq.h>
#include <linux/in6.h>
-#include <linux/ide.h>
#include <asm/uaccess.h>
#include <asm/checksum.h>
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c
index 1bfe5d1..2a40d18 100644
--- a/drivers/misc/lkdtm.c
+++ b/drivers/misc/lkdtm.c
@@ -54,10 +54,6 @@
#include <linux/hrtimer.h>
#include <scsi/scsi_cmnd.h>
-#ifdef CONFIG_IDE
-#include <linux/ide.h>
-#endif
-
#define NUM_CPOINTS 8
#define NUM_CPOINT_TYPES 5
#define DEFAULT_COUNT 10
On Tuesday 29 July 2008, Adrian Bunk wrote:
> On Sun, Jul 27, 2008 at 04:32:16PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Sunday 27 July 2008, Adrian Bunk wrote:
> > > The sh systemh_defconfig currently fails to build with the following
> > > error:
> > >
> > > <-- snip -->
> > >
> > > ...
> > > CC arch/sh/boards/renesas/systemh/irq.o
> > > In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/boards/renesas/systemh/irq.c:16:
> > > /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/ide.h:645: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here (not in a function)
> > > make[2]: *** [arch/sh/boards/renesas/systemh/irq.o] Error 1
> >
> > Please also fix the source root of the problem:
> >
> > arch/sh/boards/renesas/systemh/irq.c should have no bussiness in
> > including include/linux/ide.h (which is for drivers/ide/ _only_)
> >...
>
> ide-scsi.c and the mediabay stuff might qualify as exceptions?
Yes, they are exceptions confirming the rule. :)
> For the rest a patch is below (on top of your #include <linux/hdreg.h>
> removal patch).
applied
On Tuesday 29 July 2008, Adrian Bunk wrote:
> On Sun, Jul 27, 2008 at 04:32:16PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Sunday 27 July 2008, Adrian Bunk wrote:
> >...
> > > <-- snip -->
> > >
> > > Considering the little benefits of all this fiddling with IDE_MAX_HWIFS
> > > I decided to fix it through a simplification:
> > > - always #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
> > > - always set CONFIG_IDE_MAX_HWIFS in kconfig
> > > - let IDE_MAX_HWIFS default to 10
> > > - allow changing the value of IDE_MAX_HWIFS only if IDE && EMBEDDED
> >
> > I was actually wondering whether it is worth to keep IDE_MAX_HWIFS
> > now that ide_hwif_t instances are allocated dynamically.
> >
> > [ The difference between MAX_HWIFS == 10 and MAX_HWIFS == 2 is now
> > ~100 bytes (x86_32) and between MAX_HWIFS == 10 and MAX_HWIFS == 1
> > it is ~1kb (IIRC). ]
> >
> > Since there were also many other improvements in shrinking drivers/ide/
> > code size which should keep embedded users happy and compensate for
> > the above 1kB-worst-case I would prefer to have IDE_MAX_HWIFS removed
> > completely.
> >...
>
> Patch below.
applied
Thanks Adrian!