]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
m68k: Make sure NR_IRQS is never zero
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 5 Nov 2024 11:14:46 +0000 (12:14 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 6 Nov 2024 14:10:14 +0000 (15:10 +0100)
When compiling an MMU kernel without any platform support, e.g.
"MMU=y allnoconfig":

    echo CONFIG_MMU=y > allno.config
    make KCONFIG_ALLCONFIG=1 allnoconfig

NR_IRQS is zero, causing a build failure:

    kernel/irq/irqdesc.c:593:3: error: array index in initializer exceeds array bounds
      593 |  [0 ... NR_IRQS-1] = {
  |   ^
    kernel/irq/irqdesc.c:593:3: note: (near initialization for ‘irq_desc’)
    kernel/irq/irqdesc.c:593:22: warning: excess elements in array initializer
      593 |  [0 ... NR_IRQS-1] = {
  |                      ^
    kernel/irq/irqdesc.c:593:22: note: (near initialization for ‘irq_desc’)

Fix this by setting the default value of NR_IRQS to 8, which is the
mininum number of interrupts on any m68k CPU (the DIP48 variant of the
MC68008 has tied IPL0 and IPL2 together, but that does not impact the
range).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/71db70dc27b46e5326518cd23cb94fa6bee172fe.1730805216.git.geert@linux-m68k.org
arch/m68k/include/asm/irq.h

index 14992fde7340161ecc64833abb8351c28aea5270..2263e92d418ab75247cab585cb17a16be98bc125 100644 (file)
 #define NR_IRQS        32
 #elif defined(CONFIG_APOLLO)
 #define NR_IRQS        24
-#elif defined(CONFIG_HP300)
+#else /* CONFIG_HP300 etc. */
 #define NR_IRQS        8
-#else
-#define NR_IRQS        0
 #endif
 
 #if defined(CONFIG_M68020) || defined(CONFIG_M68030) || \