diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index cd0cd8dcb3453aee98a20cd6652144cf10e42281..618a64f1915a81334ddded9b6b6175e44a169880 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -15,7 +15,7 @@
 
 #include "internals.h"
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
 cpumask_var_t irq_default_affinity;
 
 static int init_irq_default_affinity(void)