lkml.org 
[lkml]   [2017]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 41/55] x86/uv: Use default_cpu_mask_to_apicid_and()
Same functionality except the extra bits ored on the apicid.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
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)

\
 
 \ /
  Last update: 2017-06-20 02:04    [W:0.299 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site