diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-04-19 20:33:50 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-07-29 18:35:39 +0200 |
commit | a1ce5ba2b7d08ab6347dc254f86f70e91c5f1a44 (patch) | |
tree | 22d59faf4df1547bb9547935c7f63c3ef6a6b387 /tools/power/cpupower/utils/cpufreq-set.c | |
parent | 2cd005cac6d586b8ca324814a9c58ed0c08ffe40 (diff) |
cpupowerutils: utils - ConfigStyle bugfixes
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power/cpupower/utils/cpufreq-set.c')
-rw-r--r-- | tools/power/cpupower/utils/cpufreq-set.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c index d415b6b52a0..5f783622bf3 100644 --- a/tools/power/cpupower/utils/cpufreq-set.c +++ b/tools/power/cpupower/utils/cpufreq-set.c @@ -43,12 +43,12 @@ void freq_set_help(void) } static struct option set_opts[] = { - { .name="min", .has_arg=required_argument, .flag=NULL, .val='d'}, - { .name="max", .has_arg=required_argument, .flag=NULL, .val='u'}, - { .name="governor", .has_arg=required_argument, .flag=NULL, .val='g'}, - { .name="freq", .has_arg=required_argument, .flag=NULL, .val='f'}, - { .name="help", .has_arg=no_argument, .flag=NULL, .val='h'}, - { .name="related", .has_arg=no_argument, .flag=NULL, .val='r'}, + { .name = "min", .has_arg = required_argument, .flag = NULL, .val = 'd'}, + { .name = "max", .has_arg = required_argument, .flag = NULL, .val = 'u'}, + { .name = "governor", .has_arg = required_argument, .flag = NULL, .val = 'g'}, + { .name = "freq", .has_arg = required_argument, .flag = NULL, .val = 'f'}, + { .name = "help", .has_arg = no_argument, .flag = NULL, .val = 'h'}, + { .name = "related", .has_arg = no_argument, .flag = NULL, .val='r'}, { }, }; @@ -64,7 +64,7 @@ static void print_error(void) }; struct freq_units { - char* str_unit; + char *str_unit; int power_of_ten; }; @@ -204,7 +204,8 @@ static int do_one_cpu(unsigned int cpu, struct cpufreq_policy *new_pol, else if (new_pol->max) return cpufreq_modify_policy_max(cpu, new_pol->max); else if (new_pol->governor) - return cpufreq_modify_policy_governor(cpu, new_pol->governor); + return cpufreq_modify_policy_governor(cpu, + new_pol->governor); default: /* slow path */ @@ -282,15 +283,15 @@ int cmd_freq_set(int argc, char **argv) if ((strlen(optarg) < 3) || (strlen(optarg) > 18)) { print_unknown_arg(); return -EINVAL; - } + } if ((sscanf(optarg, "%s", gov)) != 1) { print_unknown_arg(); return -EINVAL; - } + } new_pol.governor = gov; break; } - } while(cont); + } while (cont); /* parameter checking */ if (double_parm) { @@ -339,7 +340,7 @@ int cmd_freq_set(int argc, char **argv) /* loop over CPUs */ for (cpu = bitmask_first(cpus_chosen); cpu <= bitmask_last(cpus_chosen); cpu++) { - + if (!bitmask_isbitset(cpus_chosen, cpu) || cpufreq_cpu_exists(cpu)) continue; |