All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Noonan <steven@uplinklabs.net>
To: linux-pm@vger.kernel.org
Cc: Thomas Renninger <trenn@suse.com>, Steven Noonan <steven@uplinklabs.net>
Subject: [PATCH] cpupower: fix bench check for online CPUs
Date: Sun,  4 Sep 2016 15:59:23 -0700	[thread overview]
Message-ID: <20160904225923.27993-1-steven@uplinklabs.net> (raw)

Another case of incorrectly assuming the same return values as
'cpufreq_cpu_exists' (which used to return 0 on success).

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
 tools/power/cpupower/bench/system.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/power/cpupower/bench/system.c b/tools/power/cpupower/bench/system.c
index c25a74a..b05a979 100644
--- a/tools/power/cpupower/bench/system.c
+++ b/tools/power/cpupower/bench/system.c
@@ -61,9 +61,9 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
 
 	dprintf("set %s as cpufreq governor\n", governor);
 
-	if (cpupower_is_cpu_online(cpu) != 0) {
-		perror("cpufreq_cpu_exists");
-		fprintf(stderr, "error: cpu %u does not exist\n", cpu);
+	if (cpupower_is_cpu_online(cpu) != 1) {
+		perror("cpufreq_is_cpu_online");
+		fprintf(stderr, "error: cpu %u is not online\n", cpu);
 		return -1;
 	}
 
-- 
2.9.3


                 reply	other threads:[~2016-09-04 22:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160904225923.27993-1-steven@uplinklabs.net \
    --to=steven@uplinklabs.net \
    --cc=linux-pm@vger.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.