Skip to content

Commit

Permalink
cpupower: Do not show an empty Idle_Stats monitor if no idle driver i…
Browse files Browse the repository at this point in the history
…s 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>
  • Loading branch information
watologo1 authored and Dominik Brodowski committed Aug 15, 2011
1 parent 2dfc818 commit 88f984e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 88f984e

Please sign in to comment.