diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-01-04 08:18:05 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 03:05:28 -0500 |
commit | 5cb0535f1713b51610f2881b17d0fe3656114364 (patch) | |
tree | 4d358d2db4525f6c740e055f13d99768250d1db7 /arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | |
parent | d12418fdeafdc08dd5bbec89d3e07e47ee75da55 (diff) |
cpumask: replace CPUMASK_ALLOC etc with cpumask_var_t
Impact: cleanup
There's only one user, and it's a fairly easy conversion.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c')
-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 | ||