* [PATCH] m68k: Make sure NR_IRQS is never zero
@ 2024-11-05 11:14 Geert Uytterhoeven
0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2024-11-05 11:14 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-m68k, linux-kernel, Geert Uytterhoeven
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>
---
To be queued in the m68k tree for v6.13.
arch/m68k/include/asm/irq.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 14992fde7340161e..2263e92d418ab752 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) || \
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-05 11:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-05 11:14 [PATCH] m68k: Make sure NR_IRQS is never zero Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®