[PATCH 1/4] cpu: cpufreq: add more precision to GHz CPU frequency information
Keng-Yu Lin
keng-yu.lin at canonical.com
Mon May 26 00:28:33 UTC 2014
On Fri, May 23, 2014 at 8:42 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/cpu/cpufreq/cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 4ec1f12..39d22ae 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -175,8 +175,8 @@ static char *hz_to_human(const uint64_t hz)
> {
> static char buffer[32];
>
> - if (hz > 1500000) {
> - snprintf(buffer, sizeof(buffer), "%.2f GHz",
> + if (hz > 1000000) {
> + snprintf(buffer, sizeof(buffer), "%6.3f GHz",
> (hz+50000.0) / 1000000);
> return buffer;
> } else if (hz > 1000) {
> --
> 2.0.0.rc0
>
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>
More information about the fwts-devel
mailing list