From: Qianfeng Rong Date: Tue, 2 Sep 2025 11:45:42 +0000 (+0800) Subject: cpufreq: Use int type to store negative error codes X-Git-Tag: v6.18-rc1~152^2~5^2~5^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b49d70849530f046b1f9a42c963840ca91c60929;p=thirdparty%2Flinux.git cpufreq: Use int type to store negative error codes Change the 'ret' variable in store_scaling_setspeed() from unsigned int to int, as it needs to store either negative error codes or zero returned by kstrtouint(). No effect on runtime. Signed-off-by: Qianfeng Rong Acked-by: Viresh Kumar Link: https://patch.msgid.link/20250902114545.651661-2-rongqianfeng@vivo.com Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5fcc99f768d2e..6812afdf0dbff 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -914,7 +914,7 @@ static ssize_t store_scaling_setspeed(struct cpufreq_policy *policy, const char *buf, size_t count) { unsigned int freq = 0; - unsigned int ret; + int ret; if (!policy->governor || !policy->governor->store_setspeed) return -EINVAL;