summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/utils
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-08-24 21:56:26 -0700
committerShuah Khan <skhan@linuxfoundation.org>2020-10-02 10:36:36 -0600
commitaa803771a80aa2aa2d5cdd38434b369066fbb8fc (patch)
tree06a3f5167f6ea23d3d3a01a0be73dddd7c8cbbc7 /tools/power/cpupower/utils
parentc8bd596f9388bceda6cf008d554cbb1a4f2244e7 (diff)
tools: Avoid comma separated statements
Use semicolons and braces. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/power/cpupower/utils')
-rw-r--r--tools/power/cpupower/utils/cpufreq-set.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
index 6ed82fba5aaa..7b2164e07057 100644
--- a/tools/power/cpupower/utils/cpufreq-set.c
+++ b/tools/power/cpupower/utils/cpufreq-set.c
@@ -99,13 +99,17 @@ static unsigned long string_to_frequency(const char *str)
continue;
if (str[cp] == '.') {
- while (power > -1 && isdigit(str[cp+1]))
- cp++, power--;
+ while (power > -1 && isdigit(str[cp+1])) {
+ cp++;
+ power--;
+ }
}
- if (power >= -1) /* not enough => pad */
+ if (power >= -1) { /* not enough => pad */
pad = power + 1;
- else /* to much => strip */
- pad = 0, cp += power + 1;
+ } else { /* too much => strip */
+ pad = 0;
+ cp += power + 1;
+ }
/* check bounds */
if (cp <= 0 || cp + pad > NORM_FREQ_LEN - 1)
return 0;