Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools / cpupower: Fix no idle state information return value

sysfs_get_idlestate_count() returns an unsigned int. Returning -ENODEV
is not the right thing to do here, and in any case is handled the same
way as if there are no states found.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Prarit Bhargava and committed by
Rafael J. Wysocki
a59e5109 ad1d8313

+1 -1
+1 -1
tools/power/cpupower/utils/helpers/sysfs.c
··· 361 361 362 362 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); 363 363 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) 364 - return -ENODEV; 364 + return 0; 365 365 366 366 snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); 367 367 if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))