From: Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>
To: torvalds-Lhe3bsMrZseB+jHODAdFcQ@public.gmane.org,
andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cpufreq-1walMZg8u8rXmaaqVzeoHQ@public.gmane.org,
acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 2.5.54] cpufreq: remove deprecated usage of CPUFREQ_ALL_CPUS in ACPI
Date: Thu, 2 Jan 2003 22:44:52 +0100 [thread overview]
Message-ID: <20030102214452.GF19479@brodo.de> (raw)
As policy->cpu now only points to an existing CPU, some code can
safely be removed from the ACPI P-States cpufreq driver.
Dominik
diff -ruN linux-original/drivers/acpi/processor.c linux/drivers/acpi/processor.c
--- linux-original/drivers/acpi/processor.c 2003-01-02 20:56:57.000000000 +0100
+++ linux/drivers/acpi/processor.c 2003-01-02 21:17:34.000000000 +0100
@@ -1669,24 +1669,10 @@
if (!policy)
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 +1701,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);
}
@@ -1746,24 +1722,10 @@
if (!policy)
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(
@@ -1787,6 +1749,11 @@
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
}
+ cpufreq_verify_within_limits(
+ policy,
+ pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000,
+ pr->performance.states[pr->limit.state.px].core_frequency * 1000);
+
return_VALUE(0);
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
WARNING: multiple messages have this Message-ID (diff)
From: Dominik Brodowski <linux@brodo.de>
To: torvalds@transmeta.com, andrew.grover@intel.com
Cc: linux-kernel@vger.kernel.org, cpufreq@www.linux.org.uk,
acpi-devel@lists.sourceforge.net
Subject: [PATCH 2.5.54] cpufreq: remove deprecated usage of CPUFREQ_ALL_CPUS in ACPI
Date: Thu, 2 Jan 2003 22:44:52 +0100 [thread overview]
Message-ID: <20030102214452.GF19479@brodo.de> (raw)
As policy->cpu now only points to an existing CPU, some code can
safely be removed from the ACPI P-States cpufreq driver.
Dominik
diff -ruN linux-original/drivers/acpi/processor.c linux/drivers/acpi/processor.c
--- linux-original/drivers/acpi/processor.c 2003-01-02 20:56:57.000000000 +0100
+++ linux/drivers/acpi/processor.c 2003-01-02 21:17:34.000000000 +0100
@@ -1669,24 +1669,10 @@
if (!policy)
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 +1701,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);
}
@@ -1746,24 +1722,10 @@
if (!policy)
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(
@@ -1787,6 +1749,11 @@
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
}
+ cpufreq_verify_within_limits(
+ policy,
+ pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000,
+ pr->performance.states[pr->limit.state.px].core_frequency * 1000);
+
return_VALUE(0);
}
next reply other threads:[~2003-01-02 21:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-02 21:44 Dominik Brodowski [this message]
2003-01-02 21:44 ` [PATCH 2.5.54] cpufreq: remove deprecated usage of CPUFREQ_ALL_CPUS in ACPI Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030102214452.GF19479@brodo.de \
--to=linux-jhlenvuh02m@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=cpufreq-1walMZg8u8rXmaaqVzeoHQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=torvalds-Lhe3bsMrZseB+jHODAdFcQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.