cpufreq: more cleanups
PATCH 1/1 cpufreq: more cleanups
these patches require:
cpufreq-2.4.74-bk6-{cleanup,doc_update,kobj_release,move_restore}
cpufreq-2.4.74-bk6-rmmod - don't care about rmmod -f
cpufreq-2.4.74-bk6-include - (mostly) whitespace cleanup
Dominik
- CPUFREQ_ALL_CPUS is not a valid argument any more, don't mention it in include/linux/cpufreq.h
- without a driver->init() function a cpufreq driver isn't even loaded, so remove that check in the per-CPU initialization
- whitespace and clarification changes to linux/cpufreq.h
drivers/cpufreq/proc_intf.c | 2 + include/linux/cpufreq.h | 67 +++++++++++++++++++++++--------------------- kernel/cpufreq.c | 8 +---- 3 files changed, 41 insertions(+), 36 deletions(-)
drivers/cpufreq/proc_intf.c +2 -0
@@ -13,6 +13,8 @@#include <asm/uaccess.h> +#define CPUFREQ_ALL_CPUS ((NR_CPUS)) +/** * cpufreq_parse_policy - parse a policy string * @input_string: the string to parse.
include/linux/cpufreq.h +36 -31
120 lines not on this page · raw message
kernel/cpufreq.c +3 -5
@@ -337,11 +337,9 @@*/ policy = &cpufreq_driver->policy[cpu]; policy->cpu = cpu; -if (cpufreq_driver->init) { - ret = cpufreq_driver->init (policy); -if (ret) - goto out; - } + ret = cpufreq_driver->init (policy); +if (ret) + goto out;/* set default policy on this CPU */ down (&cpufreq_driver_sem);
- don't care about "rmmod -f". It's expected to break things.
- whitespace cleanup
kernel/cpufreq.c | 25 +------------------------ 1 files changed, 1 insertion(+), 24 deletions(-)
kernel/cpufreq.c +1 -24
@@ -627,33 +627,10 @@void cpufreq_unregister_governor (struct cpufreq_governor *governor) { -unsigned int i; -if (!governor)return ;down (&cpufreq_governor_sem); - -/* -* Unless the user uses rmmod -f, we can be safe. But we never -* know, so check whether if it's currently used. If so, -* stop it and replace it with the default governor. -*/ -for (i=0 ; i<NR_CPUS ; i++) - { -if (!cpufreq_cpu_get (i)) -continue ; -if ((cpufreq_driver->policy[i].policy ==CPUFREQ_POLICY_GOVERNOR ) && - (cpufreq_driver->policy[i].governor == governor)) { -cpufreq_governor (i,CPUFREQ_GOV_STOP ); - cpufreq_driver->policy[i].policy =CPUFREQ_POLICY_PERFORMANCE ; -cpufreq_governor (i,CPUFREQ_GOV_START ); -cpufreq_governor (i,CPUFREQ_GOV_LIMITS ); - } -cpufreq_cpu_put (i); - } - -/* now we can safely remove it from the list */ list_del (&governor->governor_list);up (&cpufreq_governor_sem);return ;
@@ -821,7 +798,7 @@switch (state) {case CPUFREQ_PRECHANGE :notifier_call_chain (&cpufreq_transition_notifier_list,CPUFREQ_PRECHANGE , freqs); -adjust_jiffies (CPUFREQ_PRECHANGE , freqs); +adjust_jiffies (CPUFREQ_PRECHANGE , freqs);break ;case CPUFREQ_POSTCHANGE :adjust_jiffies (CPUFREQ_POSTCHANGE , freqs);