cpumask: alloc zeroed cpumask for static cpumask_var_ts
These are defined as static cpumask_var_t so if MAXSMP is not used, they are cleared already. Avoid surprises when MAXSMP is enabled. Signed-off-by: Yinghai Lu <yinghai.lu@kernel.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:

committed by
Rusty Russell

parent
0281b5dc03
commit
eaa958402e
@@ -550,7 +550,7 @@ static int __init acpi_cpufreq_early_init(void)
|
||||
return -ENOMEM;
|
||||
}
|
||||
for_each_possible_cpu(i) {
|
||||
if (!alloc_cpumask_var_node(
|
||||
if (!zalloc_cpumask_var_node(
|
||||
&per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
|
||||
GFP_KERNEL, cpu_to_node(i))) {
|
||||
|
||||
|
@@ -322,7 +322,7 @@ static int powernow_acpi_init(void)
|
||||
goto err0;
|
||||
}
|
||||
|
||||
if (!alloc_cpumask_var(&acpi_processor_perf->shared_cpu_map,
|
||||
if (!zalloc_cpumask_var(&acpi_processor_perf->shared_cpu_map,
|
||||
GFP_KERNEL)) {
|
||||
retval = -ENOMEM;
|
||||
goto err05;
|
||||
|
@@ -887,7 +887,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
|
||||
/* notify BIOS that we exist */
|
||||
acpi_processor_notify_smm(THIS_MODULE);
|
||||
|
||||
if (!alloc_cpumask_var(&data->acpi_data.shared_cpu_map, GFP_KERNEL)) {
|
||||
if (!zalloc_cpumask_var(&data->acpi_data.shared_cpu_map, GFP_KERNEL)) {
|
||||
printk(KERN_ERR PFX
|
||||
"unable to alloc powernow_k8_data cpumask\n");
|
||||
ret_val = -ENOMEM;
|
||||
|
@@ -471,7 +471,7 @@ static int centrino_target (struct cpufreq_policy *policy,
|
||||
|
||||
if (unlikely(!alloc_cpumask_var(&saved_mask, GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
if (unlikely(!alloc_cpumask_var(&covered_cpus, GFP_KERNEL))) {
|
||||
if (unlikely(!zalloc_cpumask_var(&covered_cpus, GFP_KERNEL))) {
|
||||
free_cpumask_var(saved_mask);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@@ -1163,7 +1163,7 @@ static __init int mce_init_device(void)
|
||||
if (!mce_available(&boot_cpu_data))
|
||||
return -EIO;
|
||||
|
||||
alloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
|
||||
zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
|
||||
|
||||
err = mce_init_banks();
|
||||
if (err)
|
||||
|
Reference in New Issue
Block a user