Thread (5 messages) 5 messages, 3 authors, 2025-08-26

Re: [PATCH v1] cpufreq: use __free() for all cpufreq_cpu_get() references

From: Zihuan Zhang <hidden>
Date: 2025-08-26 00:32:47
Also in: dri-devel, imx, intel-gfx, kvm, linux-acpi, linux-mediatek, linux-omap, linux-pm, linux-samsung-soc, linux-tegra, lkml

在 2025/8/25 22:13, Rafael J. Wysocki 写道:
On Mon, Aug 25, 2025 at 11:29 AM Zihuan Zhang [off-list ref] wrote:
quoted
This patch replaces all remaining uses of cpufreq_cpu_get() with
the __free(cpufreq_cpu_put) annotation.

Motivation:
- Ensures automatic cleanup of policy references when they go out of scope,
   reducing the risk of forgetting to call cpufreq_cpu_put() on early return
   or error paths.
- Brings the code in line with the latest kernel coding style and best
   practices for managing reference-counted objects.
- No functional changes are introduced; behavior remains the same,
   but reference counting is now safer and easier to maintain.

Signed-off-by: Zihuan Zhang <redacted>
---
  arch/arm64/kernel/topology.c                  |  9 +++----
  arch/x86/kvm/x86.c                            | 10 ++++----
  drivers/acpi/processor_thermal.c              | 13 ++++------
  drivers/cpufreq/brcmstb-avs-cpufreq.c         |  4 +---
  drivers/cpufreq/cppc_cpufreq.c                |  4 +---
  drivers/cpufreq/intel_pstate.c                |  3 +--
  drivers/cpufreq/longhaul.c                    |  3 +--
  drivers/cpufreq/mediatek-cpufreq.c            |  6 ++---
  drivers/cpufreq/powernv-cpufreq.c             |  6 ++---
  drivers/cpufreq/s5pv210-cpufreq.c             |  3 +--
  drivers/cpufreq/tegra186-cpufreq.c            |  3 +--
  drivers/devfreq/governor_passive.c            | 19 ++++-----------
  drivers/gpu/drm/i915/gt/intel_llc.c           |  3 +--
  drivers/macintosh/windfarm_cpufreq_clamp.c    |  4 +---
  drivers/powercap/dtpm_cpu.c                   | 24 ++++++-------------
  drivers/thermal/imx_thermal.c                 |  7 ++----
  .../ti-soc-thermal/ti-thermal-common.c        |  5 +---
  kernel/power/energy_model.c                   |  7 ++----
  18 files changed, 40 insertions(+), 93 deletions(-)
This changes different pieces of code maintained by different people
and the changes are not interdependent AFAICS, so better send it as a
series of separate patches.

Thanks!
Thanks for the suggestion.

I agree, splitting it into a series will make the review much clearer.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help