[PATCH 2.5] cpufreq: deprecated use of CPUFREQ_ALL_CPUS (ACPI)

From: Dominik Brodowski (linux@brodo.de)
Date: Sun Dec 22 2002 - 05:22:08 EST


CPUFREQ_ALL_CPUS isn't a valid argument for the cpufreq_driver->setpolicy
call - so some code paths can be removed.

        Dominik

diff -ruN linux-original/drivers/acpi/processor.c linux/drivers/acpi/processor.c
--- linux-original/drivers/acpi/processor.c 2002-12-21 14:53:47.000000000 +0100
+++ linux/drivers/acpi/processor.c 2002-12-22 11:01:51.000000000 +0100
@@ -1670,23 +1670,10 @@
                 return_VALUE(-EINVAL);
 
         /* get a present, initialized CPU */
- if (policy->cpu == CPUFREQ_ALL_CPUS)
- {
- for (i=0; i<NR_CPUS; i++) {
- if (processors[i] != NULL) {
- cpu = i;
- pr = processors[cpu];
- break;
- }
- }
- }
- else
- {
- cpu = policy->cpu;
- pr = processors[cpu];
- if (!pr)
- return_VALUE(-EINVAL);
- }
+ cpu = policy->cpu;
+ pr = processors[cpu];
+ if (!pr)
+ return_VALUE(-EINVAL);
 
         /* select appropriate P-State */
         if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
@@ -1715,19 +1702,9 @@
         }
 
         /* set one or all CPUs to the new state */
- if (policy->cpu == CPUFREQ_ALL_CPUS) {
- for (i=0; i<NR_CPUS; i++)
- {
- pr = processors[cpu];
- if (!pr || !cpu_online(cpu))
- continue;
- result = acpi_processor_set_performance (pr, next_state);
- }
- } else {
- result = acpi_processor_set_performance (pr, next_state);
- }
+ result = acpi_processor_set_performance (pr, next_state);
 
- return_VALUE(0);
+ return_VALUE(result);
 }
 
 
@@ -1747,23 +1724,10 @@
                 return_VALUE(-EINVAL);
 
         /* get a present, initialized CPU */
- if (policy->cpu == CPUFREQ_ALL_CPUS)
- {
- for (i=0; i<NR_CPUS; i++) {
- if (processors[i] != NULL) {
- cpu = i;
- pr = processors[cpu];
- break;
- }
- }
- }
- else
- {
- cpu = policy->cpu;
- pr = processors[cpu];
- if (!pr)
- return_VALUE(-EINVAL);
- }
+ cpu = policy->cpu;
+ pr = processors[cpu];
+ if (!pr)
+ return_VALUE(-EINVAL);
 
         /* first check if min and max are within valid limits */
         cpufreq_verify_within_limits(
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:30 EST