diff options
Diffstat (limited to 'tools/power/cpupower/utils/cpuidle-info.c')
-rw-r--r-- | tools/power/cpupower/utils/cpuidle-info.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c index b028267c1376..8145af5f93a6 100644 --- a/tools/power/cpupower/utils/cpuidle-info.c +++ b/tools/power/cpupower/utils/cpuidle-info.c | |||
@@ -35,17 +35,9 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose) | |||
35 | printf(_("CPU %u: Can't read idle state info\n"), cpu); | 35 | printf(_("CPU %u: Can't read idle state info\n"), cpu); |
36 | return; | 36 | return; |
37 | } | 37 | } |
38 | tmp = sysfs_get_idlestate_name(cpu, idlestates - 1); | ||
39 | if (!tmp) { | ||
40 | printf(_("Could not determine max idle state %u\n"), | ||
41 | idlestates - 1); | ||
42 | return; | ||
43 | } | ||
44 | |||
45 | printf(_("Number of idle states: %d\n"), idlestates); | 38 | printf(_("Number of idle states: %d\n"), idlestates); |
46 | |||
47 | printf(_("Available idle states:")); | 39 | printf(_("Available idle states:")); |
48 | for (idlestate = 1; idlestate < idlestates; idlestate++) { | 40 | for (idlestate = 0; idlestate < idlestates; idlestate++) { |
49 | tmp = sysfs_get_idlestate_name(cpu, idlestate); | 41 | tmp = sysfs_get_idlestate_name(cpu, idlestate); |
50 | if (!tmp) | 42 | if (!tmp) |
51 | continue; | 43 | continue; |
@@ -57,7 +49,7 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose) | |||
57 | if (!verbose) | 49 | if (!verbose) |
58 | return; | 50 | return; |
59 | 51 | ||
60 | for (idlestate = 1; idlestate < idlestates; idlestate++) { | 52 | for (idlestate = 0; idlestate < idlestates; idlestate++) { |
61 | tmp = sysfs_get_idlestate_name(cpu, idlestate); | 53 | tmp = sysfs_get_idlestate_name(cpu, idlestate); |
62 | if (!tmp) | 54 | if (!tmp) |
63 | continue; | 55 | continue; |