[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250819105524.qdkitat35fvnfmh2@vireshk-i7>
Date: Tue, 19 Aug 2025 16:25:24 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Zihuan Zhang <zhangzihuan@...inos.cn>
Cc: "rafael J . wysocki" <rafael@...nel.org>,
zhenglifeng <zhenglifeng1@...wei.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] cpufreq: use strlen() for governor name comparison
On 19-08-25, 18:39, Zihuan Zhang wrote:
> Most kernel code using strncasecmp()/strncmp() passes strlen("xxx")
> as the length argument. cpufreq_parse_policy() previously used
> CPUFREQ_NAME_LEN (16), which is longer than the actual strings
> ("performance" is 11 chars, "powersave" is 9 chars).
>
> This patch switches to strlen() for the comparison, making the
> matching slightly more permissive (e.g., "powersavexxx" will now
> also match "powersave"). While this is unlikely to cause functional
> issues, it aligns cpufreq with common kernel style and makes the
> behavior more intuitive.
>
> Signed-off-by: Zihuan Zhang <zhangzihuan@...inos.cn>
> ---
> drivers/cpufreq/cpufreq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
--
viresh
Powered by blists - more mailing lists