浏览代码

powerpc/cpumask: Convert smp_cpus_done to new cpumask API

Use the new cpumask_* functions and dynamically allocate the cpumask in
smp_cpus_done.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Anton Blanchard 15 年之前
父节点
当前提交
bfb9126def
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      arch/powerpc/kernel/smp.c

+ 6 - 3
arch/powerpc/kernel/smp.c

@@ -562,19 +562,22 @@ int setup_profiling_timer(unsigned int multiplier)
 
 
 void __init smp_cpus_done(unsigned int max_cpus)
 void __init smp_cpus_done(unsigned int max_cpus)
 {
 {
-	cpumask_t old_mask;
+	cpumask_var_t old_mask;
 
 
 	/* We want the setup_cpu() here to be called from CPU 0, but our
 	/* We want the setup_cpu() here to be called from CPU 0, but our
 	 * init thread may have been "borrowed" by another CPU in the meantime
 	 * init thread may have been "borrowed" by another CPU in the meantime
 	 * se we pin us down to CPU 0 for a short while
 	 * se we pin us down to CPU 0 for a short while
 	 */
 	 */
-	old_mask = current->cpus_allowed;
+	alloc_cpumask_var(&old_mask, GFP_NOWAIT);
+	cpumask_copy(old_mask, &current->cpus_allowed);
 	set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
 	set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
 	
 	
 	if (smp_ops && smp_ops->setup_cpu)
 	if (smp_ops && smp_ops->setup_cpu)
 		smp_ops->setup_cpu(boot_cpuid);
 		smp_ops->setup_cpu(boot_cpuid);
 
 
-	set_cpus_allowed_ptr(current, &old_mask);
+	set_cpus_allowed_ptr(current, old_mask);
+
+	free_cpumask_var(old_mask);
 
 
 	snapshot_timebases();
 	snapshot_timebases();