diff mbox

cpupower: fix bench check for online CPUs

Message ID 20160904225923.27993-1-steven@uplinklabs.net (mailing list archive)
State Deferred
Headers show

Commit Message

Steven Noonan Sept. 4, 2016, 10:59 p.m. UTC
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 mbox

Patch

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;
 	}