Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Always output 2 digits for the cpu frequenc...



details:   https://anonhg.NetBSD.org/src/rev/f752d8130761
branches:  trunk
changeset: 337484:f752d8130761
user:      njoly <njoly%NetBSD.org@localhost>
date:      Thu Apr 16 15:17:17 2015 +0000

description:
Always output 2 digits for the cpu frequency decimal part.

diffstat:

 sys/arch/x86/x86/procfs_machdep.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0db353f4eefa -r f752d8130761 sys/arch/x86/x86/procfs_machdep.c
--- a/sys/arch/x86/x86/procfs_machdep.c Thu Apr 16 13:31:03 2015 +0000
+++ b/sys/arch/x86/x86/procfs_machdep.c Thu Apr 16 15:17:17 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.7 2015/04/16 15:17:17 njoly Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.7 2015/04/16 15:17:17 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -196,7 +196,7 @@
 
                freq = (ci->ci_data.cpu_cc_freq + 4999) / 1000000;
                fraq = ((ci->ci_data.cpu_cc_freq + 4999) / 10000) % 100;
-               l = snprintf(p, left, "cpu MHz\t\t: %" PRIu64 ".%" PRIu64 "\n",
+               l = snprintf(p, left, "cpu MHz\t\t: %" PRIu64 ".%02" PRIu64 "\n",
                    freq, fraq);
        } else
                l = snprintf(p, left, "cpu MHz\t\t: unknown\n");



Home | Main Index | Thread Index | Old Index