diff options
author | Prarit Bhargava <prarit@redhat.com> | 2017-10-25 15:51:32 +0200 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-11-03 16:28:02 +0100 |
commit | 9da779c324db87ca340e0eb1259c949874f17bed (patch) | |
tree | b6850615fcddeea9e71796393454248fb8a6568f /tools/power | |
parent | Linux 4.14-rc7 (diff) | |
download | linux-9da779c324db87ca340e0eb1259c949874f17bed.tar.xz linux-9da779c324db87ca340e0eb1259c949874f17bed.zip |
cpupower: Fix no-rounding MHz frequency output
'cpupower frequency-info -ln' returns kHz values on systems with MHz range
minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system
the command returns
hardware limits: 800000 MHz - 4.200000 GHz
The code that causes this error can be removed. The next else if clause
will handle the output correctly such that
hardware limits: 800.000 MHz - 4.200000 GHz
is displayed correctly.
[v2]: Remove two lines instead of fixing broken code.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Renninger <trenn@suse.com>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/power')
-rw-r--r-- | tools/power/cpupower/utils/cpufreq-info.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index 3e701f0e9c14..df43cd45d810 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -93,8 +93,6 @@ static void print_speed(unsigned long speed) if (speed > 1000000) printf("%u.%06u GHz", ((unsigned int) speed/1000000), ((unsigned int) speed%1000000)); - else if (speed > 100000) - printf("%u MHz", (unsigned int) speed); else if (speed > 1000) printf("%u.%03u MHz", ((unsigned int) speed/1000), (unsigned int) (speed%1000)); |