From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753659AbdFVRIt (ORCPT ); Thu, 22 Jun 2017 13:08:49 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57405 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752741AbdFVRIp (ORCPT ); Thu, 22 Jun 2017 13:08:45 -0400 Date: Thu, 22 Jun 2017 10:03:01 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, hpa@zytor.com, marc.zyngier@arm.com, tglx@linutronix.de, keith.busch@intel.com, mpe@ellerman.id.au, axboe@kernel.dk, mingo@kernel.org, hch@lst.de Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, marc.zyngier@arm.com, hpa@zytor.com, peterz@infradead.org, axboe@kernel.dk, mingo@kernel.org, keith.busch@intel.com, mpe@ellerman.id.au, hch@lst.de In-Reply-To: <20170619235446.482841015@linutronix.de> References: <20170619235446.482841015@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] x86/uv: Use default_cpu_mask_to_apicid_and() Git-Commit-ID: bbcf9574bc6fb85d22f2718d48da7f98830a7870 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: bbcf9574bc6fb85d22f2718d48da7f98830a7870 Gitweb: http://git.kernel.org/tip/bbcf9574bc6fb85d22f2718d48da7f98830a7870 Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:41 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:21 +0200 x86/uv: Use default_cpu_mask_to_apicid_and() Same functionality except the extra bits ored on the apicid. Signed-off-by: Thomas Gleixner Cc: Jens Axboe Cc: Marc Zyngier Cc: Michael Ellerman Cc: Keith Busch Cc: Peter Zijlstra Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20170619235446.482841015@linutronix.de --- arch/x86/kernel/apic/x2apic_uv_x.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index b487b3a..fd5bb20 100644 --- 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 cpumask *cpumask, 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 (likely(cpu < nr_cpu_ids)) { - *apicid = per_cpu(x86_cpu_to_apicid, cpu) | uv_apicid_hibits; - return 0; - } + if (!ret) + *apicid |= uv_apicid_hibits; - return -EINVAL; + return ret; } static unsigned int x2apic_get_apic_id(unsigned long x)