diff options
| author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2006-04-27 05:25:00 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2006-05-13 23:11:29 -0400 |
| commit | 193de0c79da580eb33a66113b62e2378fc1fb629 (patch) | |
| tree | 62e278011d758b57105af7d00d1b0b9977d0f2e3 | |
| parent | 9011bff4bdc0fef1f9a782d7415c306ee61826c9 (diff) | |
ACPI: use for_each_possible_cpu() instead of for_each_cpu()
for_each_cpu() actually iterates across all possible CPUs. We've had mistakes
in the past where people were using for_each_cpu() where they should have been
iterating across only online or present CPUs. This is inefficient and
possibly buggy.
We're renaming for_each_cpu() to for_each_possible_cpu() to avoid this in the
future.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
| -rw-r--r-- | drivers/acpi/processor_perflib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 431a8450346b..cf6167003d8a 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
| @@ -628,7 +628,7 @@ int acpi_processor_preregister_performance( | |||
| 628 | retval = 0; | 628 | retval = 0; |
| 629 | 629 | ||
| 630 | /* Call _PSD for all CPUs */ | 630 | /* Call _PSD for all CPUs */ |
| 631 | for_each_cpu(i) { | 631 | for_each_possible_cpu(i) { |
| 632 | pr = processors[i]; | 632 | pr = processors[i]; |
| 633 | if (!pr) { | 633 | if (!pr) { |
| 634 | /* Look only at processors in ACPI namespace */ | 634 | /* Look only at processors in ACPI namespace */ |
| @@ -659,7 +659,7 @@ int acpi_processor_preregister_performance( | |||
| 659 | * Now that we have _PSD data from all CPUs, lets setup P-state | 659 | * Now that we have _PSD data from all CPUs, lets setup P-state |
| 660 | * domain info. | 660 | * domain info. |
| 661 | */ | 661 | */ |
| 662 | for_each_cpu(i) { | 662 | for_each_possible_cpu(i) { |
| 663 | pr = processors[i]; | 663 | pr = processors[i]; |
| 664 | if (!pr) | 664 | if (!pr) |
| 665 | continue; | 665 | continue; |
| @@ -680,7 +680,7 @@ int acpi_processor_preregister_performance( | |||
| 680 | } | 680 | } |
| 681 | 681 | ||
| 682 | cpus_clear(covered_cpus); | 682 | cpus_clear(covered_cpus); |
| 683 | for_each_cpu(i) { | 683 | for_each_possible_cpu(i) { |
| 684 | pr = processors[i]; | 684 | pr = processors[i]; |
| 685 | if (!pr) | 685 | if (!pr) |
| 686 | continue; | 686 | continue; |
| @@ -704,7 +704,7 @@ int acpi_processor_preregister_performance( | |||
| 704 | pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; | 704 | pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; |
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | for_each_cpu(j) { | 707 | for_each_possible_cpu(j) { |
| 708 | if (i == j) | 708 | if (i == j) |
| 709 | continue; | 709 | continue; |
| 710 | 710 | ||
| @@ -733,7 +733,7 @@ int acpi_processor_preregister_performance( | |||
| 733 | count++; | 733 | count++; |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | for_each_cpu(j) { | 736 | for_each_possible_cpu(j) { |
| 737 | if (i == j) | 737 | if (i == j) |
| 738 | continue; | 738 | continue; |
| 739 | 739 | ||
| @@ -757,7 +757,7 @@ err_ret: | |||
| 757 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error while parsing _PSD domain information. Assuming no coordination\n")); | 757 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error while parsing _PSD domain information. Assuming no coordination\n")); |
| 758 | } | 758 | } |
| 759 | 759 | ||
| 760 | for_each_cpu(i) { | 760 | for_each_possible_cpu(i) { |
| 761 | pr = processors[i]; | 761 | pr = processors[i]; |
| 762 | if (!pr || !pr->performance) | 762 | if (!pr || !pr->performance) |
| 763 | continue; | 763 | continue; |
