From f535660d2c6e5188668a6f4f02dd47fb19582d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=BB=A1?= <22373570@buaa.edu.cn> Date: Tue, 10 Jun 2025 14:16:41 +0000 Subject: [PATCH] =?UTF-8?q?update=20drivers/cpufreq/cpufreq.c.=20drivers/c?= =?UTF-8?q?pufreq:=20fixes=20to=20the=20AGFL=20repair=20code=20Mainline=20?= =?UTF-8?q?inclusion=20Commit=20787025a462c7e85d1cfe6294a70c65f1f74031f2?= =?UTF-8?q?=20Category:=20bugfix=20Reference:=20https://git.kernel.org/pub?= =?UTF-8?q?/scm/linux/kernel/git/torvalds/linux.git/commit/=3Fid=3D787025a?= =?UTF-8?q?462c7e85d1cfe6294a70c65f1f74031f2=20---------------------------?= =?UTF-8?q?---------------------------=20Merge=20the=20second=20round=20of?= =?UTF-8?q?=20changes=20for=20amd-pstate=20in=206.11=20from=20Mario=20Limo?= =?UTF-8?q?nciello:=20"*=20Enables=20amd-pstate=20by=20default=20in=20"sha?= =?UTF-8?q?red=20memory"=20designs=20without=20=20=20=20a=20dedicated=20MS?= =?UTF-8?q?R.=20=20*=20Adds=20extra=20infrastructure=20for=20debugging=20p?= =?UTF-8?q?roblems.=20=20*=20Bug=20fixes=20found=20for=20init/unload=20fai?= =?UTF-8?q?lure."=20Signed-off-by:=20=E5=BC=A0=E6=BB=A1=20<22373570@buaa.e?= =?UTF-8?q?du.cn>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张满 <22373570@buaa.edu.cn> --- drivers/cpufreq/cpufreq.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index df445b44e9ec..cdcfed7db1cf 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -605,10 +605,9 @@ static ssize_t show_boost(struct kobject *kobj, static ssize_t store_boost(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { - int ret, enable; + bool enable; - ret = sscanf(buf, "%d", &enable); - if (ret != 1 || enable < 0 || enable > 1) + if (kstrtobool(buf, &enable)) return -EINVAL; if (cpufreq_boost_trigger_state(enable)) { @@ -632,10 +631,10 @@ static ssize_t show_local_boost(struct cpufreq_policy *policy, char *buf) static ssize_t store_local_boost(struct cpufreq_policy *policy, const char *buf, size_t count) { - int ret, enable; + int ret; + bool enable; - ret = kstrtoint(buf, 10, &enable); - if (ret || enable < 0 || enable > 1) + if (kstrtobool(buf, &enable)) return -EINVAL; if (!cpufreq_driver->boost_enabled) -- Gitee