diff options
author | Dave Jones <davej@redhat.com> | 2009-01-18 01:39:51 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2009-02-24 22:47:29 -0500 |
commit | 9acef4875695a7717734f2578666a64822ea6495 (patch) | |
tree | a28764742190a657ed7c939319aa5619ed123083 | |
parent | 29464f281389fd7e9adf969de7bbeb20b8596f82 (diff) |
[CPUFREQ] checkpatch cleanups for conservative governor
Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 0320962c4ec5..c6b3c6a02fc9 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -82,7 +82,7 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
82 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | 82 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock |
83 | * is recursive for the same process. -Venki | 83 | * is recursive for the same process. -Venki |
84 | */ | 84 | */ |
85 | static DEFINE_MUTEX (dbs_mutex); | 85 | static DEFINE_MUTEX(dbs_mutex); |
86 | static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer); | 86 | static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer); |
87 | 87 | ||
88 | struct dbs_tuners { | 88 | struct dbs_tuners { |
@@ -140,12 +140,12 @@ static struct notifier_block dbs_cpufreq_notifier_block = { | |||
140 | /************************** sysfs interface ************************/ | 140 | /************************** sysfs interface ************************/ |
141 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) | 141 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) |
142 | { | 142 | { |
143 | return sprintf (buf, "%u\n", MAX_SAMPLING_RATE); | 143 | return sprintf(buf, "%u\n", MAX_SAMPLING_RATE); |
144 | } | 144 | } |
145 | 145 | ||
146 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) | 146 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) |
147 | { | 147 | { |
148 | return sprintf (buf, "%u\n", MIN_SAMPLING_RATE); | 148 | return sprintf(buf, "%u\n", MIN_SAMPLING_RATE); |
149 | } | 149 | } |
150 | 150 | ||
151 | #define define_one_ro(_name) \ | 151 | #define define_one_ro(_name) \ |
@@ -174,7 +174,7 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, | |||
174 | { | 174 | { |
175 | unsigned int input; | 175 | unsigned int input; |
176 | int ret; | 176 | int ret; |
177 | ret = sscanf (buf, "%u", &input); | 177 | ret = sscanf(buf, "%u", &input); |
178 | if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) | 178 | if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) |
179 | return -EINVAL; | 179 | return -EINVAL; |
180 | 180 | ||
@@ -190,10 +190,11 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused, | |||
190 | { | 190 | { |
191 | unsigned int input; | 191 | unsigned int input; |
192 | int ret; | 192 | int ret; |
193 | ret = sscanf (buf, "%u", &input); | 193 | ret = sscanf(buf, "%u", &input); |
194 | 194 | ||
195 | mutex_lock(&dbs_mutex); | 195 | mutex_lock(&dbs_mutex); |
196 | if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) { | 196 | if (ret != 1 || input > MAX_SAMPLING_RATE || |
197 | input < MIN_SAMPLING_RATE) { | ||
197 | mutex_unlock(&dbs_mutex); | 198 | mutex_unlock(&dbs_mutex); |
198 | return -EINVAL; | 199 | return -EINVAL; |
199 | } | 200 | } |
@@ -209,10 +210,11 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused, | |||
209 | { | 210 | { |
210 | unsigned int input; | 211 | unsigned int input; |
211 | int ret; | 212 | int ret; |
212 | ret = sscanf (buf, "%u", &input); | 213 | ret = sscanf(buf, "%u", &input); |
213 | 214 | ||
214 | mutex_lock(&dbs_mutex); | 215 | mutex_lock(&dbs_mutex); |
215 | if (ret != 1 || input > 100 || input <= dbs_tuners_ins.down_threshold) { | 216 | if (ret != 1 || input > 100 || |
217 | input <= dbs_tuners_ins.down_threshold) { | ||
216 | mutex_unlock(&dbs_mutex); | 218 | mutex_unlock(&dbs_mutex); |
217 | return -EINVAL; | 219 | return -EINVAL; |
218 | } | 220 | } |
@@ -228,7 +230,7 @@ static ssize_t store_down_threshold(struct cpufreq_policy *unused, | |||
228 | { | 230 | { |
229 | unsigned int input; | 231 | unsigned int input; |
230 | int ret; | 232 | int ret; |
231 | ret = sscanf (buf, "%u", &input); | 233 | ret = sscanf(buf, "%u", &input); |
232 | 234 | ||
233 | mutex_lock(&dbs_mutex); | 235 | mutex_lock(&dbs_mutex); |
234 | if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) { | 236 | if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) { |
@@ -310,7 +312,7 @@ define_one_rw(down_threshold); | |||
310 | define_one_rw(ignore_nice_load); | 312 | define_one_rw(ignore_nice_load); |
311 | define_one_rw(freq_step); | 313 | define_one_rw(freq_step); |
312 | 314 | ||
313 | static struct attribute * dbs_attributes[] = { | 315 | static struct attribute *dbs_attributes[] = { |
314 | &sampling_rate_max.attr, | 316 | &sampling_rate_max.attr, |
315 | &sampling_rate_min.attr, | 317 | &sampling_rate_min.attr, |
316 | &sampling_rate.attr, | 318 | &sampling_rate.attr, |
@@ -600,11 +602,11 @@ static void __exit cpufreq_gov_dbs_exit(void) | |||
600 | } | 602 | } |
601 | 603 | ||
602 | 604 | ||
603 | MODULE_AUTHOR ("Alexander Clouter <alex-kernel@digriz.org.uk>"); | 605 | MODULE_AUTHOR("Alexander Clouter <alex-kernel@digriz.org.uk>"); |
604 | MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for " | 606 | MODULE_DESCRIPTION("'cpufreq_conservative' - A dynamic cpufreq governor for " |
605 | "Low Latency Frequency Transition capable processors " | 607 | "Low Latency Frequency Transition capable processors " |
606 | "optimised for use in a battery environment"); | 608 | "optimised for use in a battery environment"); |
607 | MODULE_LICENSE ("GPL"); | 609 | MODULE_LICENSE("GPL"); |
608 | 610 | ||
609 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE | 611 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE |
610 | fs_initcall(cpufreq_gov_dbs_init); | 612 | fs_initcall(cpufreq_gov_dbs_init); |