diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c index f0ea6fa2f53c..d2cc4991cbaa 100644 --- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | |||
@@ -458,11 +458,6 @@ static int centrino_verify (struct cpufreq_policy *policy) | |||
458 | * | 458 | * |
459 | * Sets a new CPUFreq policy. | 459 | * Sets a new CPUFreq policy. |
460 | */ | 460 | */ |
461 | struct allmasks { | ||
462 | cpumask_t saved_mask; | ||
463 | cpumask_t covered_cpus; | ||
464 | }; | ||
465 | |||
466 | static int centrino_target (struct cpufreq_policy *policy, | 461 | static int centrino_target (struct cpufreq_policy *policy, |
467 | unsigned int target_freq, | 462 | unsigned int target_freq, |
468 | unsigned int relation) | 463 | unsigned int relation) |
@@ -472,12 +467,15 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
472 | struct cpufreq_freqs freqs; | 467 | struct cpufreq_freqs freqs; |
473 | int retval = 0; | 468 | int retval = 0; |
474 | unsigned int j, k, first_cpu, tmp; | 469 | unsigned int j, k, first_cpu, tmp; |
475 | CPUMASK_ALLOC(allmasks); | 470 | cpumask_var_t saved_mask, covered_cpus; |
476 | CPUMASK_PTR(saved_mask, allmasks); | ||
477 | CPUMASK_PTR(covered_cpus, allmasks); | ||
478 | 471 | ||
479 | if (unlikely(allmasks == NULL)) | 472 | if (unlikely(!alloc_cpumask_var(&saved_mask, GFP_KERNEL))) |
480 | return -ENOMEM; | 473 | return -ENOMEM; |
474 | if (unlikely(!alloc_cpumask_var(&covered_cpus, GFP_KERNEL))) { | ||
475 | free_cpumask_var(saved_mask); | ||
476 | return -ENOMEM; | ||
477 | } | ||
478 | cpumask_copy(saved_mask, ¤t->cpus_allowed); | ||
481 | 479 | ||
482 | if (unlikely(per_cpu(centrino_model, cpu) == NULL)) { | 480 | if (unlikely(per_cpu(centrino_model, cpu) == NULL)) { |
483 | retval = -ENODEV; | 481 | retval = -ENODEV; |
@@ -493,9 +491,7 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
493 | goto out; | 491 | goto out; |
494 | } | 492 | } |
495 | 493 | ||
496 | *saved_mask = current->cpus_allowed; | ||
497 | first_cpu = 1; | 494 | first_cpu = 1; |
498 | cpus_clear(*covered_cpus); | ||
499 | for_each_cpu_mask_nr(j, policy->cpus) { | 495 | for_each_cpu_mask_nr(j, policy->cpus) { |
500 | const cpumask_t *mask; | 496 | const cpumask_t *mask; |
501 | 497 | ||
@@ -605,7 +601,8 @@ migrate_end: | |||
605 | preempt_enable(); | 601 | preempt_enable(); |
606 | set_cpus_allowed_ptr(current, saved_mask); | 602 | set_cpus_allowed_ptr(current, saved_mask); |
607 | out: | 603 | out: |
608 | CPUMASK_FREE(allmasks); | 604 | free_cpumask_var(saved_mask); |
605 | free_cpumask_var(covered_cpus); | ||
609 | return retval; | 606 | return retval; |
610 | } | 607 | } |
611 | 608 | ||