[PATCH v2 06/18] cpufreq: intel_pstate: Use __free(put_cpufreq_policy) for policy reference

From
Zihuan Zhang <hidden>
Date
2025-08-27 02:34:03
Also in
dri-devel, imx, intel-gfx, kvm, linux-acpi, linux-mediatek, linux-omap, linux-pm, linux-samsung-soc, linux-tegra, lkml
Reply to
Zihuan Zhang, 2025-08-27
Replace the manual cpufreq_cpu_put() with __free(put_cpufreq_policy)
annotation for policy references. This reduces the risk of reference
counting mistakes and aligns the code with the latest kernel style.

No functional change intended.

Signed-off-by: Zihuan Zhang <redacted>
---
 drivers/cpufreq/intel_pstate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index f366d35c5840..4e7e2990e9a6 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1698,19 +1698,18 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
 static void update_qos_request(enum freq_qos_req_type type)
 {
 	struct freq_qos_request *req;
-	struct cpufreq_policy *policy;
 	int i;
 
 	for_each_possible_cpu(i) {
 		struct cpudata *cpu = all_cpu_data[i];
 		unsigned int freq, perf_pct;
+		struct cpufreq_policy *policy __free(put_cpufreq_policy);
 
 		policy = cpufreq_cpu_get(i);
 		if (!policy)
 			continue;
 
 		req = policy->driver_data;
-		cpufreq_cpu_put(policy);
 
 		if (!req)
 			continue;
-- 
2.25.1

Thread (39 messages) 39 messages, 6 authors, last reply 2025-08-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help