diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-06-19 04:49:33 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-06-20 19:06:34 -0400 |
commit | bb176f7d038fee4d46b3293e64e173bfb05ab7b5 (patch) | |
tree | 3083ebddffa88ffe7e4889dc1ba618bb55c89953 /include/linux/cpufreq.h | |
parent | 95731ebb114c5f0c028459388560fc2a72fe5049 (diff) |
cpufreq: Fix minor formatting issues
There were a few noticeable formatting issues in core cpufreq code.
This cleans them up to make code look better. The changes include:
- Whitespace cleanup.
- Rearrangements of code.
- Multiline comments fixes.
- Formatting changes to fit 80 columns.
Copyright information in cpufreq.c is also updated to include my name
for 2013.
[rjw: Changelog]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 125719d41285..3c7ee2f90370 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/cpufreq.h | 2 | * linux/include/linux/cpufreq.h |
3 | * | 3 | * |
4 | * Copyright (C) 2001 Russell King | 4 | * Copyright (C) 2001 Russell King |
5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> | 5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -26,7 +26,6 @@ | |||
26 | /* Print length for names. Extra 1 space for accomodating '\n' in prints */ | 26 | /* Print length for names. Extra 1 space for accomodating '\n' in prints */ |
27 | #define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) | 27 | #define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) |
28 | 28 | ||
29 | |||
30 | /********************************************************************* | 29 | /********************************************************************* |
31 | * CPUFREQ NOTIFIER INTERFACE * | 30 | * CPUFREQ NOTIFIER INTERFACE * |
32 | *********************************************************************/ | 31 | *********************************************************************/ |
@@ -153,17 +152,18 @@ struct cpufreq_freqs { | |||
153 | u8 flags; /* flags of cpufreq_driver, see below. */ | 152 | u8 flags; /* flags of cpufreq_driver, see below. */ |
154 | }; | 153 | }; |
155 | 154 | ||
156 | |||
157 | /** | 155 | /** |
158 | * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch safe) | 156 | * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch |
157 | * safe) | ||
159 | * @old: old value | 158 | * @old: old value |
160 | * @div: divisor | 159 | * @div: divisor |
161 | * @mult: multiplier | 160 | * @mult: multiplier |
162 | * | 161 | * |
163 | * | 162 | * |
164 | * new = old * mult / div | 163 | * new = old * mult / div |
165 | */ | 164 | */ |
166 | static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mult) | 165 | static inline unsigned long cpufreq_scale(unsigned long old, u_int div, |
166 | u_int mult) | ||
167 | { | 167 | { |
168 | #if BITS_PER_LONG == 32 | 168 | #if BITS_PER_LONG == 32 |
169 | 169 | ||
@@ -216,14 +216,12 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
216 | unsigned int target_freq, | 216 | unsigned int target_freq, |
217 | unsigned int relation); | 217 | unsigned int relation); |
218 | 218 | ||
219 | |||
220 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, | 219 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, |
221 | unsigned int cpu); | 220 | unsigned int cpu); |
222 | 221 | ||
223 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 222 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
224 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 223 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
225 | 224 | ||
226 | |||
227 | /********************************************************************* | 225 | /********************************************************************* |
228 | * CPUFREQ DRIVER INTERFACE * | 226 | * CPUFREQ DRIVER INTERFACE * |
229 | *********************************************************************/ | 227 | *********************************************************************/ |
@@ -234,7 +232,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor); | |||
234 | struct freq_attr; | 232 | struct freq_attr; |
235 | 233 | ||
236 | struct cpufreq_driver { | 234 | struct cpufreq_driver { |
237 | struct module *owner; | 235 | struct module *owner; |
238 | char name[CPUFREQ_NAME_LEN]; | 236 | char name[CPUFREQ_NAME_LEN]; |
239 | u8 flags; | 237 | u8 flags; |
240 | /* | 238 | /* |
@@ -282,11 +280,11 @@ struct cpufreq_driver { | |||
282 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 280 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
283 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 281 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
284 | 282 | ||
285 | |||
286 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 283 | void cpufreq_notify_transition(struct cpufreq_policy *policy, |
287 | struct cpufreq_freqs *freqs, unsigned int state); | 284 | struct cpufreq_freqs *freqs, unsigned int state); |
288 | 285 | ||
289 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) | 286 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, |
287 | unsigned int min, unsigned int max) | ||
290 | { | 288 | { |
291 | if (policy->min < min) | 289 | if (policy->min < min) |
292 | policy->min = min; | 290 | policy->min = min; |
@@ -349,7 +347,9 @@ bool have_governor_per_policy(void); | |||
349 | struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); | 347 | struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); |
350 | 348 | ||
351 | #ifdef CONFIG_CPU_FREQ | 349 | #ifdef CONFIG_CPU_FREQ |
352 | /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ | 350 | /* |
351 | * query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it | ||
352 | */ | ||
353 | unsigned int cpufreq_get(unsigned int cpu); | 353 | unsigned int cpufreq_get(unsigned int cpu); |
354 | #else | 354 | #else |
355 | static inline unsigned int cpufreq_get(unsigned int cpu) | 355 | static inline unsigned int cpufreq_get(unsigned int cpu) |
@@ -358,7 +358,9 @@ static inline unsigned int cpufreq_get(unsigned int cpu) | |||
358 | } | 358 | } |
359 | #endif | 359 | #endif |
360 | 360 | ||
361 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | 361 | /* |
362 | * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it | ||
363 | */ | ||
362 | #ifdef CONFIG_CPU_FREQ | 364 | #ifdef CONFIG_CPU_FREQ |
363 | unsigned int cpufreq_quick_get(unsigned int cpu); | 365 | unsigned int cpufreq_quick_get(unsigned int cpu); |
364 | unsigned int cpufreq_quick_get_max(unsigned int cpu); | 366 | unsigned int cpufreq_quick_get_max(unsigned int cpu); |
@@ -373,16 +375,14 @@ static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) | |||
373 | } | 375 | } |
374 | #endif | 376 | #endif |
375 | 377 | ||
376 | |||
377 | /********************************************************************* | 378 | /********************************************************************* |
378 | * CPUFREQ DEFAULT GOVERNOR * | 379 | * CPUFREQ DEFAULT GOVERNOR * |
379 | *********************************************************************/ | 380 | *********************************************************************/ |
380 | 381 | ||
381 | |||
382 | /* | 382 | /* |
383 | Performance governor is fallback governor if any other gov failed to | 383 | * Performance governor is fallback governor if any other gov failed to auto |
384 | auto load due latency restrictions | 384 | * load due latency restrictions |
385 | */ | 385 | */ |
386 | #ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE | 386 | #ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE |
387 | extern struct cpufreq_governor cpufreq_gov_performance; | 387 | extern struct cpufreq_governor cpufreq_gov_performance; |
388 | #endif | 388 | #endif |
@@ -402,7 +402,6 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
402 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) | 402 | #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) |
403 | #endif | 403 | #endif |
404 | 404 | ||
405 | |||
406 | /********************************************************************* | 405 | /********************************************************************* |
407 | * FREQUENCY TABLE HELPERS * | 406 | * FREQUENCY TABLE HELPERS * |
408 | *********************************************************************/ | 407 | *********************************************************************/ |