summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2024-11-05 12:14:46 +0100
committerGeert Uytterhoeven <geert@linux-m68k.org>2024-11-06 15:10:14 +0100
commitb6fb218cf90bb2579c9e8191ac2aa3ce4d2536cf (patch)
treec643bb27304521fa99130a2730ca092f7fce846f
parent4760df6c170792054d6473a2850bc2af9188ea33 (diff)
downloadlinux-b6fb218cf90bb2579c9e8191ac2aa3ce4d2536cf.tar.gz
linux-b6fb218cf90bb2579c9e8191ac2aa3ce4d2536cf.tar.bz2
linux-b6fb218cf90bb2579c9e8191ac2aa3ce4d2536cf.zip
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
-rw-r--r--arch/m68k/include/asm/irq.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 14992fde7340..2263e92d418a 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -28,10 +28,8 @@
#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) || \