diff options
author | Laura Abbott <labbott@fedoraproject.org> | 2016-09-14 09:42:37 -0700 |
---|---|---|
committer | Laura Abbott <labbott@fedoraproject.org> | 2016-09-14 09:42:37 -0700 |
commit | 5c9789dfbf0d03b7a3266b3d94cdd40dc0ba5c6d (patch) | |
tree | a96ace6889de76ae0ac52a86135501368c8048b8 /0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch | |
parent | 591c00b16c4bb5694297079ab9d6ea4a5ad7dcb7 (diff) | |
download | kernel-5c9789dfbf0d03b7a3266b3d94cdd40dc0ba5c6d.tar.gz kernel-5c9789dfbf0d03b7a3266b3d94cdd40dc0ba5c6d.tar.xz kernel-5c9789dfbf0d03b7a3266b3d94cdd40dc0ba5c6d.zip |
Fix for incorrect return checking in cpupower (rhbz 1374212)
- Let iio tools build on older kernels
Diffstat (limited to '0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch')
-rw-r--r-- | 0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch b/0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch new file mode 100644 index 000000000..05b8cf999 --- /dev/null +++ b/0001-cpupower-Correct-return-type-of-cpu_power_is_cpu_onl.patch @@ -0,0 +1,49 @@ +From 9f692cbe4a01dd9e3c3e954ec6b59662b68f9ce4 Mon Sep 17 00:00:00 2001 +From: Laura Abbott <labbott@redhat.com> +Date: Fri, 9 Sep 2016 10:19:02 -0700 +Subject: [PATCH] cpupower: Correct return type of cpu_power_is_cpu_online in + cpufreq +To: Thomas Renninger <trenn@suse.com> +Cc: linux-pm@vger.kernel.org +Cc: linux-kernel@vger.kernel.org + +When converting to a shared library in ac5a181d065d ("cpupower: Add +cpuidle parts into library"), cpu_freq_cpu_exists was converted to +cpupower_is_cpu_online. cpu_req_cpu_exists returned 0 on success and +-ENOSYS on failure whereas cpupower_is_cpu_online returns 1 on success. +Check for the correct return value in cpufreq-set. + +See https://bugzilla.redhat.com/show_bug.cgi?id=1374212 + +Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library") +Reported-by: Julian Seward <jseward@acm.org> +Signed-off-by: Laura Abbott <labbott@redhat.com> +--- + tools/power/cpupower/utils/cpufreq-set.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c +index b4bf769..8971d71 100644 +--- a/tools/power/cpupower/utils/cpufreq-set.c ++++ b/tools/power/cpupower/utils/cpufreq-set.c +@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv) + struct cpufreq_affected_cpus *cpus; + + if (!bitmask_isbitset(cpus_chosen, cpu) || +- cpupower_is_cpu_online(cpu)) ++ cpupower_is_cpu_online(cpu) != 1) + continue; + + cpus = cpufreq_get_related_cpus(cpu); +@@ -316,7 +316,7 @@ int cmd_freq_set(int argc, char **argv) + cpu <= bitmask_last(cpus_chosen); cpu++) { + + if (!bitmask_isbitset(cpus_chosen, cpu) || +- cpupower_is_cpu_online(cpu)) ++ cpupower_is_cpu_online(cpu) != 1) + continue; + + if (cpupower_is_cpu_online(cpu) != 1) +-- +2.10.0 + |