aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStratos Karafotis <stratosk@semaphore.gr>2014-07-18 11:37:19 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-21 07:43:18 -0400
commit845c1cbef08c87d2a4e7ca3c82ac2363637fdcb9 (patch)
treeb9b21212d0f2323b9910a900d135514e997af14c
parentfa30dff9a81ea9fdc2e985a14fe14ce6393a3214 (diff)
cpufreq: intel_pstate: Add missing blank lines after declarations
Also, remove unnecessary blank lines. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/intel_pstate.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index e5fd78072f8b..e9f3048eb6f2 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -37,7 +37,6 @@
37#define BYT_TURBO_RATIOS 0x66c 37#define BYT_TURBO_RATIOS 0x66c
38#define BYT_TURBO_VIDS 0x66d 38#define BYT_TURBO_VIDS 0x66d
39 39
40
41#define FRAC_BITS 8 40#define FRAC_BITS 8
42#define int_tofp(X) ((int64_t)(X) << FRAC_BITS) 41#define int_tofp(X) ((int64_t)(X) << FRAC_BITS)
43#define fp_toint(X) ((X) >> FRAC_BITS) 42#define fp_toint(X) ((X) >> FRAC_BITS)
@@ -167,7 +166,6 @@ static inline void pid_i_gain_set(struct _pid *pid, int percent)
167 166
168static inline void pid_d_gain_set(struct _pid *pid, int percent) 167static inline void pid_d_gain_set(struct _pid *pid, int percent)
169{ 168{
170
171 pid->d_gain = div_fp(int_tofp(percent), int_tofp(100)); 169 pid->d_gain = div_fp(int_tofp(percent), int_tofp(100));
172} 170}
173 171
@@ -217,6 +215,7 @@ static inline void intel_pstate_busy_pid_reset(struct cpudata *cpu)
217static inline void intel_pstate_reset_all_pid(void) 215static inline void intel_pstate_reset_all_pid(void)
218{ 216{
219 unsigned int cpu; 217 unsigned int cpu;
218
220 for_each_online_cpu(cpu) { 219 for_each_online_cpu(cpu) {
221 if (all_cpu_data[cpu]) 220 if (all_cpu_data[cpu])
222 intel_pstate_busy_pid_reset(all_cpu_data[cpu]); 221 intel_pstate_busy_pid_reset(all_cpu_data[cpu]);
@@ -230,6 +229,7 @@ static int pid_param_set(void *data, u64 val)
230 intel_pstate_reset_all_pid(); 229 intel_pstate_reset_all_pid();
231 return 0; 230 return 0;
232} 231}
232
233static int pid_param_get(void *data, u64 *val) 233static int pid_param_get(void *data, u64 *val)
234{ 234{
235 *val = *(u32 *)data; 235 *val = *(u32 *)data;
@@ -284,6 +284,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
284{ 284{
285 unsigned int input; 285 unsigned int input;
286 int ret; 286 int ret;
287
287 ret = sscanf(buf, "%u", &input); 288 ret = sscanf(buf, "%u", &input);
288 if (ret != 1) 289 if (ret != 1)
289 return -EINVAL; 290 return -EINVAL;
@@ -300,6 +301,7 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b,
300{ 301{
301 unsigned int input; 302 unsigned int input;
302 int ret; 303 int ret;
304
303 ret = sscanf(buf, "%u", &input); 305 ret = sscanf(buf, "%u", &input);
304 if (ret != 1) 306 if (ret != 1)
305 return -EINVAL; 307 return -EINVAL;
@@ -307,6 +309,7 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b,
307 limits.max_sysfs_pct = clamp_t(int, input, 0 , 100); 309 limits.max_sysfs_pct = clamp_t(int, input, 0 , 100);
308 limits.max_perf_pct = min(limits.max_policy_pct, limits.max_sysfs_pct); 310 limits.max_perf_pct = min(limits.max_policy_pct, limits.max_sysfs_pct);
309 limits.max_perf = div_fp(int_tofp(limits.max_perf_pct), int_tofp(100)); 311 limits.max_perf = div_fp(int_tofp(limits.max_perf_pct), int_tofp(100));
312
310 return count; 313 return count;
311} 314}
312 315
@@ -315,6 +318,7 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b,
315{ 318{
316 unsigned int input; 319 unsigned int input;
317 int ret; 320 int ret;
321
318 ret = sscanf(buf, "%u", &input); 322 ret = sscanf(buf, "%u", &input);
319 if (ret != 1) 323 if (ret != 1)
320 return -EINVAL; 324 return -EINVAL;
@@ -360,6 +364,7 @@ static void __init intel_pstate_sysfs_expose_params(void)
360static int byt_get_min_pstate(void) 364static int byt_get_min_pstate(void)
361{ 365{
362 u64 value; 366 u64 value;
367
363 rdmsrl(BYT_RATIOS, value); 368 rdmsrl(BYT_RATIOS, value);
364 return (value >> 8) & 0x7F; 369 return (value >> 8) & 0x7F;
365} 370}
@@ -367,6 +372,7 @@ static int byt_get_min_pstate(void)
367static int byt_get_max_pstate(void) 372static int byt_get_max_pstate(void)
368{ 373{
369 u64 value; 374 u64 value;
375
370 rdmsrl(BYT_RATIOS, value); 376 rdmsrl(BYT_RATIOS, value);
371 return (value >> 16) & 0x7F; 377 return (value >> 16) & 0x7F;
372} 378}
@@ -374,6 +380,7 @@ static int byt_get_max_pstate(void)
374static int byt_get_turbo_pstate(void) 380static int byt_get_turbo_pstate(void)
375{ 381{
376 u64 value; 382 u64 value;
383
377 rdmsrl(BYT_TURBO_RATIOS, value); 384 rdmsrl(BYT_TURBO_RATIOS, value);
378 return value & 0x7F; 385 return value & 0x7F;
379} 386}
@@ -407,7 +414,6 @@ static void byt_get_vid(struct cpudata *cpudata)
407{ 414{
408 u64 value; 415 u64 value;
409 416
410
411 rdmsrl(BYT_VIDS, value); 417 rdmsrl(BYT_VIDS, value);
412 cpudata->vid.min = int_tofp((value >> 8) & 0x7f); 418 cpudata->vid.min = int_tofp((value >> 8) & 0x7f);
413 cpudata->vid.max = int_tofp((value >> 16) & 0x7f); 419 cpudata->vid.max = int_tofp((value >> 16) & 0x7f);
@@ -420,10 +426,10 @@ static void byt_get_vid(struct cpudata *cpudata)
420 cpudata->vid.turbo = value & 0x7f; 426 cpudata->vid.turbo = value & 0x7f;
421} 427}
422 428
423
424static int core_get_min_pstate(void) 429static int core_get_min_pstate(void)
425{ 430{
426 u64 value; 431 u64 value;
432
427 rdmsrl(MSR_PLATFORM_INFO, value); 433 rdmsrl(MSR_PLATFORM_INFO, value);
428 return (value >> 40) & 0xFF; 434 return (value >> 40) & 0xFF;
429} 435}
@@ -431,6 +437,7 @@ static int core_get_min_pstate(void)
431static int core_get_max_pstate(void) 437static int core_get_max_pstate(void)
432{ 438{
433 u64 value; 439 u64 value;
440
434 rdmsrl(MSR_PLATFORM_INFO, value); 441 rdmsrl(MSR_PLATFORM_INFO, value);
435 return (value >> 8) & 0xFF; 442 return (value >> 8) & 0xFF;
436} 443}
@@ -439,6 +446,7 @@ static int core_get_turbo_pstate(void)
439{ 446{
440 u64 value; 447 u64 value;
441 int nont, ret; 448 int nont, ret;
449
442 rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value); 450 rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
443 nont = core_get_max_pstate(); 451 nont = core_get_max_pstate();
444 ret = ((value) & 255); 452 ret = ((value) & 255);
@@ -493,12 +501,12 @@ static struct cpu_defaults byt_params = {
493 }, 501 },
494}; 502};
495 503
496
497static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) 504static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
498{ 505{
499 int max_perf = cpu->pstate.turbo_pstate; 506 int max_perf = cpu->pstate.turbo_pstate;
500 int max_perf_adj; 507 int max_perf_adj;
501 int min_perf; 508 int min_perf;
509
502 if (limits.no_turbo) 510 if (limits.no_turbo)
503 max_perf = cpu->pstate.max_pstate; 511 max_perf = cpu->pstate.max_pstate;
504 512