aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2009-01-18 01:37:11 -0500
committerDave Jones <davej@redhat.com>2009-02-24 22:47:29 -0500
commit29464f281389fd7e9adf969de7bbeb20b8596f82 (patch)
tree7efe93cfa513898aa2144733aacb61ce8f9beee6 /drivers/cpufreq
parent6072ace436800a011c3cb9a75ee49276bd90445a (diff)
[CPUFREQ] checkpatch cleanups for cpufreq core
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b55cb67435bd..1867dac35aff 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -104,7 +104,8 @@ EXPORT_SYMBOL_GPL(unlock_policy_rwsem_write);
104 104
105 105
106/* internal prototypes */ 106/* internal prototypes */
107static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); 107static int __cpufreq_governor(struct cpufreq_policy *policy,
108 unsigned int event);
108static unsigned int __cpufreq_get(unsigned int cpu); 109static unsigned int __cpufreq_get(unsigned int cpu);
109static void handle_update(struct work_struct *work); 110static void handle_update(struct work_struct *work);
110 111
@@ -128,7 +129,7 @@ static int __init init_cpufreq_transition_notifier_list(void)
128pure_initcall(init_cpufreq_transition_notifier_list); 129pure_initcall(init_cpufreq_transition_notifier_list);
129 130
130static LIST_HEAD(cpufreq_governor_list); 131static LIST_HEAD(cpufreq_governor_list);
131static DEFINE_MUTEX (cpufreq_governor_mutex); 132static DEFINE_MUTEX(cpufreq_governor_mutex);
132 133
133struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) 134struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
134{ 135{
@@ -371,7 +372,7 @@ static struct cpufreq_governor *__find_governor(const char *str_governor)
371 struct cpufreq_governor *t; 372 struct cpufreq_governor *t;
372 373
373 list_for_each_entry(t, &cpufreq_governor_list, governor_list) 374 list_for_each_entry(t, &cpufreq_governor_list, governor_list)
374 if (!strnicmp(str_governor,t->name,CPUFREQ_NAME_LEN)) 375 if (!strnicmp(str_governor, t->name, CPUFREQ_NAME_LEN))
375 return t; 376 return t;
376 377
377 return NULL; 378 return NULL;
@@ -429,15 +430,11 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
429 430
430 mutex_unlock(&cpufreq_governor_mutex); 431 mutex_unlock(&cpufreq_governor_mutex);
431 } 432 }
432 out: 433out:
433 return err; 434 return err;
434} 435}
435 436
436 437
437/* drivers/base/cpu.c */
438extern struct sysdev_class cpu_sysdev_class;
439
440
441/** 438/**
442 * cpufreq_per_cpu_attr_read() / show_##file_name() - 439 * cpufreq_per_cpu_attr_read() / show_##file_name() -
443 * print out cpufreq information 440 * print out cpufreq information
@@ -450,7 +447,7 @@ extern struct sysdev_class cpu_sysdev_class;
450static ssize_t show_##file_name \ 447static ssize_t show_##file_name \
451(struct cpufreq_policy *policy, char *buf) \ 448(struct cpufreq_policy *policy, char *buf) \
452{ \ 449{ \
453 return sprintf (buf, "%u\n", policy->object); \ 450 return sprintf(buf, "%u\n", policy->object); \
454} 451}
455 452
456show_one(cpuinfo_min_freq, cpuinfo.min_freq); 453show_one(cpuinfo_min_freq, cpuinfo.min_freq);
@@ -476,7 +473,7 @@ static ssize_t store_##file_name \
476 if (ret) \ 473 if (ret) \
477 return -EINVAL; \ 474 return -EINVAL; \
478 \ 475 \
479 ret = sscanf (buf, "%u", &new_policy.object); \ 476 ret = sscanf(buf, "%u", &new_policy.object); \
480 if (ret != 1) \ 477 if (ret != 1) \
481 return -EINVAL; \ 478 return -EINVAL; \
482 \ 479 \
@@ -486,8 +483,8 @@ static ssize_t store_##file_name \
486 return ret ? ret : count; \ 483 return ret ? ret : count; \
487} 484}
488 485
489store_one(scaling_min_freq,min); 486store_one(scaling_min_freq, min);
490store_one(scaling_max_freq,max); 487store_one(scaling_max_freq, max);
491 488
492/** 489/**
493 * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware 490 * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware
@@ -507,12 +504,13 @@ static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy,
507 */ 504 */
508static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf) 505static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
509{ 506{
510 if(policy->policy == CPUFREQ_POLICY_POWERSAVE) 507 if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
511 return sprintf(buf, "powersave\n"); 508 return sprintf(buf, "powersave\n");
512 else if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) 509 else if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
513 return sprintf(buf, "performance\n"); 510 return sprintf(buf, "performance\n");
514 else if (policy->governor) 511 else if (policy->governor)
515 return scnprintf(buf, CPUFREQ_NAME_LEN, "%s\n", policy->governor->name); 512 return scnprintf(buf, CPUFREQ_NAME_LEN, "%s\n",
513 policy->governor->name);
516 return -EINVAL; 514 return -EINVAL;
517} 515}
518 516
@@ -531,7 +529,7 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
531 if (ret) 529 if (ret)
532 return ret; 530 return ret;
533 531
534 ret = sscanf (buf, "%15s", str_governor); 532 ret = sscanf(buf, "%15s", str_governor);
535 if (ret != 1) 533 if (ret != 1)
536 return -EINVAL; 534 return -EINVAL;
537 535
@@ -575,7 +573,8 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
575 } 573 }
576 574
577 list_for_each_entry(t, &cpufreq_governor_list, governor_list) { 575 list_for_each_entry(t, &cpufreq_governor_list, governor_list) {
578 if (i >= (ssize_t) ((PAGE_SIZE / sizeof(char)) - (CPUFREQ_NAME_LEN + 2))) 576 if (i >= (ssize_t) ((PAGE_SIZE / sizeof(char))
577 - (CPUFREQ_NAME_LEN + 2)))
579 goto out; 578 goto out;
580 i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name); 579 i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name);
581 } 580 }
@@ -594,7 +593,7 @@ static ssize_t show_cpus(const struct cpumask *mask, char *buf)
594 i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), " "); 593 i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), " ");
595 i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), "%u", cpu); 594 i += scnprintf(&buf[i], (PAGE_SIZE - i - 2), "%u", cpu);
596 if (i >= (PAGE_SIZE - 5)) 595 if (i >= (PAGE_SIZE - 5))
597 break; 596 break;
598 } 597 }
599 i += sprintf(&buf[i], "\n"); 598 i += sprintf(&buf[i], "\n");
600 return i; 599 return i;
@@ -684,10 +683,10 @@ static struct attribute *default_attrs[] = {
684 NULL 683 NULL
685}; 684};
686 685
687#define to_policy(k) container_of(k,struct cpufreq_policy,kobj) 686#define to_policy(k) container_of(k, struct cpufreq_policy, kobj)
688#define to_attr(a) container_of(a,struct freq_attr,attr) 687#define to_attr(a) container_of(a, struct freq_attr, attr)
689 688
690static ssize_t show(struct kobject *kobj, struct attribute *attr ,char *buf) 689static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
691{ 690{
692 struct cpufreq_policy *policy = to_policy(kobj); 691 struct cpufreq_policy *policy = to_policy(kobj);
693 struct freq_attr *fattr = to_attr(attr); 692 struct freq_attr *fattr = to_attr(attr);
@@ -858,10 +857,10 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
858 if (cpu == j) 857 if (cpu == j)
859 continue; 858 continue;
860 859
861 /* check for existing affected CPUs. They may not be aware 860 /* Check for existing affected CPUs.
862 * of it due to CPU Hotplug. 861 * They may not be aware of it due to CPU Hotplug.
863 */ 862 */
864 managed_policy = cpufreq_cpu_get(j); // FIXME: Where is this released? What about error paths? 863 managed_policy = cpufreq_cpu_get(j); /* FIXME: Where is this released? What about error paths? */
865 if (unlikely(managed_policy)) { 864 if (unlikely(managed_policy)) {
866 865
867 /* Set proper policy_cpu */ 866 /* Set proper policy_cpu */
@@ -1142,8 +1141,8 @@ static void handle_update(struct work_struct *work)
1142 * @old_freq: CPU frequency the kernel thinks the CPU runs at 1141 * @old_freq: CPU frequency the kernel thinks the CPU runs at
1143 * @new_freq: CPU frequency the CPU actually runs at 1142 * @new_freq: CPU frequency the CPU actually runs at
1144 * 1143 *
1145 * We adjust to current frequency first, and need to clean up later. So either call 1144 * We adjust to current frequency first, and need to clean up later.
1146 * to cpufreq_update_policy() or schedule handle_update()). 1145 * So either call to cpufreq_update_policy() or schedule handle_update()).
1147 */ 1146 */
1148static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, 1147static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq,
1149 unsigned int new_freq) 1148 unsigned int new_freq)
@@ -1625,7 +1624,8 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
1625 1624
1626/** 1625/**
1627 * cpufreq_get_policy - get the current cpufreq_policy 1626 * cpufreq_get_policy - get the current cpufreq_policy
1628 * @policy: struct cpufreq_policy into which the current cpufreq_policy is written 1627 * @policy: struct cpufreq_policy into which the current cpufreq_policy
1628 * is written
1629 * 1629 *
1630 * Reads the current cpufreq policy. 1630 * Reads the current cpufreq policy.
1631 */ 1631 */