All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: linux-pm@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>,
	Thomas Renninger <trenn@suse.com>,
	Stafford Horne <shorne@gmail.com>, Shuah Khan <shuah@kernel.org>
Subject: [PATCH RESEND] cpupower: Fix no-rounding MHz frequency output
Date: Mon, 23 Oct 2017 07:56:32 -0400	[thread overview]
Message-ID: <20171023115632.27998-1-prarit@redhat.com> (raw)

Sent about a year ago ...

P.

---8<---

'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 value of speed passed into print_speed is in kHz, so divide speed by
1000 in the MHz else-if section to get MHz.

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>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
index 3e701f0e9c14..fe7c25147b3a 100644
--- a/tools/power/cpupower/utils/cpufreq-info.c
+++ b/tools/power/cpupower/utils/cpufreq-info.c
@@ -94,7 +94,7 @@ static void print_speed(unsigned long speed)
 			printf("%u.%06u GHz", ((unsigned int) speed/1000000),
 				((unsigned int) speed%1000000));
 		else if (speed > 100000)
-			printf("%u MHz", (unsigned int) speed);
+			printf("%u MHz", (unsigned int) speed/1000);
 		else if (speed > 1000)
 			printf("%u.%03u MHz", ((unsigned int) speed/1000),
 				(unsigned int) (speed%1000));
-- 
2.15.0.rc0.39.g2f0e14e64

             reply	other threads:[~2017-10-23 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 11:56 Prarit Bhargava [this message]
2017-10-23 12:35 ` [PATCH RESEND] cpupower: Fix no-rounding MHz frequency output Stafford Horne
2017-10-25 13:41   ` Prarit Bhargava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171023115632.27998-1-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=shorne@gmail.com \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.