Commit 9acef487 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] checkpatch cleanups for conservative governor

Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 29464f28
...@@ -82,7 +82,7 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ ...@@ -82,7 +82,7 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */
* cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock
* is recursive for the same process. -Venki * is recursive for the same process. -Venki
*/ */
static DEFINE_MUTEX (dbs_mutex); static DEFINE_MUTEX(dbs_mutex);
static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer); static DECLARE_DELAYED_WORK(dbs_work, do_dbs_timer);
struct dbs_tuners { struct dbs_tuners {
...@@ -140,12 +140,12 @@ static struct notifier_block dbs_cpufreq_notifier_block = { ...@@ -140,12 +140,12 @@ static struct notifier_block dbs_cpufreq_notifier_block = {
/************************** sysfs interface ************************/ /************************** sysfs interface ************************/
static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)
{ {
return sprintf (buf, "%u\n", MAX_SAMPLING_RATE); return sprintf(buf, "%u\n", MAX_SAMPLING_RATE);
} }
static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)
{ {
return sprintf (buf, "%u\n", MIN_SAMPLING_RATE); return sprintf(buf, "%u\n", MIN_SAMPLING_RATE);
} }
#define define_one_ro(_name) \ #define define_one_ro(_name) \
...@@ -174,7 +174,7 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, ...@@ -174,7 +174,7 @@ static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused,
{ {
unsigned int input; unsigned int input;
int ret; int ret;
ret = sscanf (buf, "%u", &input); ret = sscanf(buf, "%u", &input);
if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
return -EINVAL; return -EINVAL;
...@@ -190,10 +190,11 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused, ...@@ -190,10 +190,11 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
{ {
unsigned int input; unsigned int input;
int ret; int ret;
ret = sscanf (buf, "%u", &input); ret = sscanf(buf, "%u", &input);
mutex_lock(&dbs_mutex); mutex_lock(&dbs_mutex);
if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) { if (ret != 1 || input > MAX_SAMPLING_RATE ||
input < MIN_SAMPLING_RATE) {
mutex_unlock(&dbs_mutex); mutex_unlock(&dbs_mutex);
return -EINVAL; return -EINVAL;
} }
...@@ -209,10 +210,11 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused, ...@@ -209,10 +210,11 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused,
{ {
unsigned int input; unsigned int input;
int ret; int ret;
ret = sscanf (buf, "%u", &input); ret = sscanf(buf, "%u", &input);
mutex_lock(&dbs_mutex); mutex_lock(&dbs_mutex);
if (ret != 1 || input > 100 || input <= dbs_tuners_ins.down_threshold) { if (ret != 1 || input > 100 ||
input <= dbs_tuners_ins.down_threshold) {
mutex_unlock(&dbs_mutex); mutex_unlock(&dbs_mutex);
return -EINVAL; return -EINVAL;
} }
...@@ -228,7 +230,7 @@ static ssize_t store_down_threshold(struct cpufreq_policy *unused, ...@@ -228,7 +230,7 @@ static ssize_t store_down_threshold(struct cpufreq_policy *unused,
{ {
unsigned int input; unsigned int input;
int ret; int ret;
ret = sscanf (buf, "%u", &input); ret = sscanf(buf, "%u", &input);
mutex_lock(&dbs_mutex); mutex_lock(&dbs_mutex);
if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) { if (ret != 1 || input > 100 || input >= dbs_tuners_ins.up_threshold) {
...@@ -310,7 +312,7 @@ define_one_rw(down_threshold); ...@@ -310,7 +312,7 @@ define_one_rw(down_threshold);
define_one_rw(ignore_nice_load); define_one_rw(ignore_nice_load);
define_one_rw(freq_step); define_one_rw(freq_step);
static struct attribute * dbs_attributes[] = { static struct attribute *dbs_attributes[] = {
&sampling_rate_max.attr, &sampling_rate_max.attr,
&sampling_rate_min.attr, &sampling_rate_min.attr,
&sampling_rate.attr, &sampling_rate.attr,
...@@ -600,11 +602,11 @@ static void __exit cpufreq_gov_dbs_exit(void) ...@@ -600,11 +602,11 @@ static void __exit cpufreq_gov_dbs_exit(void)
} }
MODULE_AUTHOR ("Alexander Clouter <alex-kernel@digriz.org.uk>"); MODULE_AUTHOR("Alexander Clouter <alex-kernel@digriz.org.uk>");
MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for " MODULE_DESCRIPTION("'cpufreq_conservative' - A dynamic cpufreq governor for "
"Low Latency Frequency Transition capable processors " "Low Latency Frequency Transition capable processors "
"optimised for use in a battery environment"); "optimised for use in a battery environment");
MODULE_LICENSE ("GPL"); MODULE_LICENSE("GPL");
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
fs_initcall(cpufreq_gov_dbs_init); fs_initcall(cpufreq_gov_dbs_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment