lkml.org 
[lkml]   [2017]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 42/52] x86/vector: Compile SMP only code conditionally
No point in compiling this for UP.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/apic/vector.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)

--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -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,

\
 
 \ /
  Last update: 2017-09-13 23:38    [W:0.311 / U:6.032 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site