Skip to content

Commit b6fb218

Browse files
committed
m68k: Make sure NR_IRQS is never zero
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
1 parent 4760df6 commit b6fb218

File tree

1 file changed

+1
-3
lines changed
  • arch/m68k/include/asm

1 file changed

+1
-3
lines changed

arch/m68k/include/asm/irq.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
#define NR_IRQS 32
2929
#elif defined(CONFIG_APOLLO)
3030
#define NR_IRQS 24
31-
#elif defined(CONFIG_HP300)
31+
#else /* CONFIG_HP300 etc. */
3232
#define NR_IRQS 8
33-
#else
34-
#define NR_IRQS 0
3533
#endif
3634

3735
#if defined(CONFIG_M68020) || defined(CONFIG_M68030) || \

0 commit comments

Comments
 (0)