From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbdIMVhY (ORCPT ); Wed, 13 Sep 2017 17:37:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40252 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbdIMVfP (ORCPT ); Wed, 13 Sep 2017 17:35:15 -0400 Message-Id: <20170913213155.603191841@linutronix.de> User-Agent: quilt/0.63-1 Date: Wed, 13 Sep 2017 23:29:44 +0200 From: Thomas Gleixner To: LKML Cc: Ingo Molnar , Peter Anvin , Marc Zyngier , Peter Zijlstra , Borislav Petkov , Chen Yu , Rui Zhang , "Rafael J. Wysocki" , Len Brown , Dan Williams , Christoph Hellwig , Paolo Bonzini , Joerg Roedel , Boris Ostrovsky , Juergen Gross , Tony Luck , "K. Y. Srinivasan" , Alok Kataria , Steven Rostedt , Arjan van de Ven Subject: [patch 42/52] x86/vector: Compile SMP only code conditionally References: <20170913212902.530704676@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=x86-vector--Compile-SMP-only-code-conditionally.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No point in compiling this for UP. Signed-off-by: Thomas Gleixner --- 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,