From: Thomas Renninger Date: Fri, 16 Dec 2011 14:35:53 +0000 (+0100) Subject: cpupower: Fix number of idle states X-Git-Tag: firefly_0821_release~3680^2~3198^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b37ee65e5d5e626b50852718ed72979160f7be0;p=firefly-linux-kernel-4.4.55.git cpupower: Fix number of idle states The number of idle states was wrong. The POLL idle state (on X86) was missed out: Number of idle states: 4 Available idle states: C1-NHM C3-NHM C6-NHM While the POLL is not a real idle state, its statistics should still be shown. It's now also explained in a detailed manpage. This should fix a bug of missing the first idle state on other archs. Signed-off-by: Thomas Renninger Signed-off-by: Dominik Brodowski --- diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c index b028267c1376..e076bebde1c4 100644 --- a/tools/power/cpupower/utils/cpuidle-info.c +++ b/tools/power/cpupower/utils/cpuidle-info.c @@ -43,9 +43,8 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose) } printf(_("Number of idle states: %d\n"), idlestates); - printf(_("Available idle states:")); - for (idlestate = 1; idlestate < idlestates; idlestate++) { + for (idlestate = 0; idlestate < idlestates; idlestate++) { tmp = sysfs_get_idlestate_name(cpu, idlestate); if (!tmp) continue; @@ -57,7 +56,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose) if (!verbose) return; - for (idlestate = 1; idlestate < idlestates; idlestate++) { + for (idlestate = 0; idlestate < idlestates; idlestate++) { tmp = sysfs_get_idlestate_name(cpu, idlestate); if (!tmp) continue;