linux/tools/power
Kaushlendra Kumar 7f6993bd32 tools/cpupower: fix error return value in cpupower_write_sysfs()
[ Upstream commit 57b100d4cf ]

The cpupower_write_sysfs() function currently returns -1 on
write failure, but the function signature indicates it should
return an unsigned int. Returning -1 from an unsigned function
results in a large positive value rather than indicating
an error condition.

Fix this by returning 0 on failure, which is more appropriate
for an unsigned return type and maintains consistency with typical
success/failure semantics where 0 indicates failure and non-zero
indicates success (bytes written).

Link: https://lore.kernel.org/r/20250828063000.803229-1-kaushlendra.kumar@intel.com
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-07 06:09:17 +09:00
..
acpi ACPICA: Tree-wide: fix various typos and spelling mistakes 2021-04-07 19:09:00 +02:00
cpupower tools/cpupower: fix error return value in cpupower_write_sysfs() 2025-12-07 06:09:17 +09:00
pm-graph pm-graph: Fix typo "accesible" 2021-03-22 15:27:17 +01:00
x86 tools/power turbostat: Remember global max_die_id 2024-07-18 13:07:30 +02:00