lkml.org 
[lkml]   [2008]   [Apr]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 05 Apr 2008 22:39:08 +0900
FromAkinobu Mita <>
Subject[patch 5/9] x86: use cpumask_of_cpu()
Use cpumask_of_cpu() rather than the pair of cpus_clear() and cpu_set().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 arch/x86/kernel/cpu/mcheck/mce_amd_64.c |    4 ++--
 arch/x86/kernel/genapic_flat_64.c       |    5 +----
 arch/x86/kernel/io_apic_64.c            |    4 +---
 3 files changed, 4 insertions(+), 9 deletions(-)
Index: 2.6-git/arch/x86/kernel/genapic_flat_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/genapic_flat_64.c
+++ 2.6-git/arch/x86/kernel/genapic_flat_64.c
@@ -138,12 +138,9 @@ static cpumask_t physflat_target_cpus(vo
 
 static cpumask_t physflat_vector_allocation_domain(int cpu)
 {
-	cpumask_t domain = CPU_MASK_NONE;
-	cpu_set(cpu, domain);
-	return domain;
+	return cpumask_of_cpu(cpu);
 }
 
-
 static void physflat_send_IPI_mask(cpumask_t cpumask, int vector)
 {
 	send_IPI_mask_sequence(cpumask, vector);
Index: 2.6-git/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ 2.6-git/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -254,8 +254,8 @@ struct threshold_attr {
 static cpumask_t affinity_set(unsigned int cpu)
 {
 	cpumask_t oldmask = current->cpus_allowed;
-	cpumask_t newmask = CPU_MASK_NONE;
-	cpu_set(cpu, newmask);
+	cpumask_t newmask = cpumask_of_cpu(cpu);
+
 	set_cpus_allowed(current, newmask);
 	return oldmask;
 }
Index: 2.6-git/arch/x86/kernel/io_apic_64.c
===================================================================
--- 2.6-git.orig/arch/x86/kernel/io_apic_64.c
+++ 2.6-git/arch/x86/kernel/io_apic_64.c
@@ -1351,9 +1351,7 @@ static int ioapic_retrigger_irq(unsigned
 	unsigned long flags;
 
 	spin_lock_irqsave(&vector_lock, flags);
-	cpus_clear(mask);
-	cpu_set(first_cpu(cfg->domain), mask);
-
+	mask = cpumask_of_cpu(first_cpu(cfg->domain));
 	send_IPI_mask(mask, cfg->vector);
 	spin_unlock_irqrestore(&vector_lock, flags);
 
-- 


\
 
 \ /
  Last update: 2008-04-05 15:55    [from the cache]
©2003-2008