mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] cpufreq: minor cleanups around policy parsing and API
@ 2025-08-19 10:39 Zihuan Zhang
  2025-08-19 10:39 ` [PATCH 1/2] cpufreq: use strlen() for governor name comparison Zihuan Zhang
  2025-08-19 10:39 ` [PATCH 2/2] cpufreq: simplify cpufreq_set_policy() interface Zihuan Zhang
  0 siblings, 2 replies; 8+ messages in thread
From: Zihuan Zhang @ 2025-08-19 10:39 UTC (permalink / raw)
  To: rafael J . wysocki, Viresh Kumar
  Cc: zhenglifeng, linux-pm, linux-kernel, Zihuan Zhang

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-08-21  8:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-19 10:39 [PATCH 0/2] cpufreq: minor cleanups around policy parsing and API Zihuan Zhang
2025-08-19 10:39 ` [PATCH 1/2] cpufreq: use strlen() for governor name comparison Zihuan Zhang
2025-08-19 10:55   ` Viresh Kumar
2025-08-19 10:39 ` [PATCH 2/2] cpufreq: simplify cpufreq_set_policy() interface Zihuan Zhang
2025-08-19 10:59   ` Viresh Kumar
2025-08-20  5:42     ` Zihuan Zhang
2025-08-20  5:47       ` Viresh Kumar
2025-08-21  8:17         ` Zihuan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®