diff options
-rw-r--r-- | tools/power/cpupower/utils/helpers/sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c index 5cdc600e8152..851c7a16ca49 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.c +++ b/tools/power/cpupower/utils/helpers/sysfs.c | |||
@@ -278,7 +278,7 @@ static char *sysfs_idlestate_get_one_string(unsigned int cpu, | |||
278 | int sysfs_is_idlestate_disabled(unsigned int cpu, | 278 | int sysfs_is_idlestate_disabled(unsigned int cpu, |
279 | unsigned int idlestate) | 279 | unsigned int idlestate) |
280 | { | 280 | { |
281 | if (sysfs_get_idlestate_count(cpu) < idlestate) | 281 | if (sysfs_get_idlestate_count(cpu) <= idlestate) |
282 | return -1; | 282 | return -1; |
283 | 283 | ||
284 | if (!sysfs_idlestate_file_exists(cpu, idlestate, | 284 | if (!sysfs_idlestate_file_exists(cpu, idlestate, |
@@ -303,7 +303,7 @@ int sysfs_idlestate_disable(unsigned int cpu, | |||
303 | char value[SYSFS_PATH_MAX]; | 303 | char value[SYSFS_PATH_MAX]; |
304 | int bytes_written; | 304 | int bytes_written; |
305 | 305 | ||
306 | if (sysfs_get_idlestate_count(cpu) < idlestate) | 306 | if (sysfs_get_idlestate_count(cpu) <= idlestate) |
307 | return -1; | 307 | return -1; |
308 | 308 | ||
309 | if (!sysfs_idlestate_file_exists(cpu, idlestate, | 309 | if (!sysfs_idlestate_file_exists(cpu, idlestate, |