From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbdFTAAZ (ORCPT ); Mon, 19 Jun 2017 20:00:25 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40193 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753207AbdFTAAS (ORCPT ); Mon, 19 Jun 2017 20:00:18 -0400 Message-Id: <20170619235446.482841015@linutronix.de> User-Agent: quilt/0.63-1 Date: Tue, 20 Jun 2017 01:37:41 +0200 From: Thomas Gleixner To: LKML Cc: Marc Zyngier , Christoph Hellwig , Ingo Molnar , Peter Zijlstra , Michael Ellerman , Jens Axboe , Keith Busch Subject: [patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and() References: <20170619233700.547167146@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=x86-uv--Use-default_cpu_mask_to_apicid_and--.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Same functionality except the extra bits ored on the apicid. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/x2apic_uv_x.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -530,23 +530,12 @@ uv_cpu_mask_to_apicid_and(const struct c const struct cpumask *andmask, unsigned int *apicid) { - int unsigned cpu; + int ret = default_cpu_mask_to_apicid_and(cpumask, andmask, apicid); - /* - * We're using fixed IRQ delivery, can only return one phys APIC ID. - * May as well be the first. - */ - for_each_cpu_and(cpu, cpumask, andmask) { - if (cpumask_test_cpu(cpu, cpu_online_mask)) - break; - } + if (!ret) + *apicid |= uv_apicid_hibits; - if (likely(cpu < nr_cpu_ids)) { - *apicid = per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits; - return 0; - } - - return -EINVAL; + return ret; } static unsigned int x2apic_get_apic_id(unsigned long x)