Skip to content

Commit

Permalink
cpupower: Fix no-rounding MHz frequency output
Browse files Browse the repository at this point in the history
'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 <[email protected]>
Cc: Thomas Renninger <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: Shuah Khan <[email protected]>
Reviewed-by: Stafford Horne <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
prarit authored and Shuah Khan committed Nov 3, 2017
1 parent 0b07194 commit 9da779c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tools/power/cpupower/utils/cpufreq-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9da779c

Please sign in to comment.