summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2011-08-12 01:11:36 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2011-08-15 20:03:05 +0200
commit88f984e0e235f82a5d34f4a99244eeb14e1413e0 (patch)
tree2935ecf2200463fbb06dab3a70fb062cd52444fc /tools
parent2dfc818b35cbea59188cc86e86e0a0efce2b0dbe (diff)
downloadlinux-88f984e0e235f82a5d34f4a99244eeb14e1413e0.tar.gz
linux-88f984e0e235f82a5d34f4a99244eeb14e1413e0.tar.bz2
linux-88f984e0e235f82a5d34f4a99244eeb14e1413e0.zip
cpupower: Do not show an empty Idle_Stats monitor if no idle driver is available
By taking error values of: sysfs_get_idlestate_count(..); into account. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
index d048b96a6155..bcd22a1a3970 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
@@ -134,7 +134,7 @@ static struct cpuidle_monitor *cpuidle_register(void)
/* Assume idle state count is the same for all CPUs */
cpuidle_sysfs_monitor.hw_states_num = sysfs_get_idlestate_count(0);
- if (cpuidle_sysfs_monitor.hw_states_num == 0)
+ if (cpuidle_sysfs_monitor.hw_states_num <= 0)
return NULL;
for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) {