x86/vector: Compile SMP only code conditionally
authorThomas Gleixner <tglx@linutronix.de>
Wed, 13 Sep 2017 21:29:44 +0000 (23:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 25 Sep 2017 18:51:59 +0000 (20:51 +0200)
No point in compiling this for UP.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Yu Chen <yu.c.chen@intel.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213155.603191841@linutronix.de
arch/x86/kernel/apic/vector.c

index 88219b8..17d7d7f 100644 (file)
@@ -450,6 +450,7 @@ int __init arch_early_irq_init(void)
        return arch_early_ioapic_init();
 }
 
+#ifdef CONFIG_SMP
 /* Temporary hack to keep things working */
 static void vector_update_shutdown_irqs(void)
 {
@@ -517,6 +518,25 @@ void lapic_offline(void)
        unlock_vector_lock();
 }
 
+static int apic_set_affinity(struct irq_data *irqd,
+                            const struct cpumask *dest, bool force)
+{
+       int err;
+
+       if (!IS_ENABLED(CONFIG_SMP))
+               return -EPERM;
+
+       if (!cpumask_intersects(dest, cpu_online_mask))
+               return -EINVAL;
+
+       err = assign_irq_vector(irqd, dest);
+       return err ? err : IRQ_SET_MASK_OK;
+}
+
+#else
+# define apic_set_affinity     NULL
+#endif
+
 static int apic_retrigger_irq(struct irq_data *irqd)
 {
        struct apic_chip_data *apicd = apic_chip_data(irqd);
@@ -536,21 +556,6 @@ void apic_ack_edge(struct irq_data *irqd)
        ack_APIC_irq();
 }
 
-static int apic_set_affinity(struct irq_data *irqd,
-                            const struct cpumask *dest, bool force)
-{
-       int err;
-
-       if (!IS_ENABLED(CONFIG_SMP))
-               return -EPERM;
-
-       if (!cpumask_intersects(dest, cpu_online_mask))
-               return -EINVAL;
-
-       err = assign_irq_vector(irqd, dest);
-       return err ? err : IRQ_SET_MASK_OK;
-}
-
 static struct irq_chip lapic_controller = {
        .name                   = "APIC",
        .irq_ack                = apic_ack_edge,