[PATCH 0/2] cpufreq: minor cleanups around policy parsing and API

From: Zihuan Zhang
Date: Tue Aug 19 2025 - 06:40:29 EST


This series contains two small cpufreq cleanups:

1) Use strlen() as the length argument for strncasecmp() in
cpufreq_parse_policy(). This makes comparison more permissive
(prefix match), which is consistent with the intention in our
deployment and improves readability over using CPUFREQ_NAME_LEN.

2) Drop the redundant `new_pol` parameter from cpufreq_set_policy().
Only drivers that implement ->setpolicy would ever care about
policy values, and passing `new_pol` around is unnecessary.
Callers now pass just the policy and (where applicable) the
governor pointer; drivers can read policy->policy directly.

No functional regressions are expected for drivers which do not
implement ->setpolicy (e.g. acpi-cpufreq), as they ignore policy
values anyway.

Zihuan Zhang (2):
cpufreq: use strlen() for governor name comparison
cpufreq: simplify cpufreq_set_policy() interface

drivers/cpufreq/cpufreq.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)

--
2.25.1