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 <zhangzih...@kylinos.cn>
---
 drivers/gpu/drm/i915/gt/intel_llc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_llc.c 
b/drivers/gpu/drm/i915/gt/intel_llc.c
index 1d19c073ba2e..53cef2ab133d 100644
--- a/drivers/gpu/drm/i915/gt/intel_llc.c
+++ b/drivers/gpu/drm/i915/gt/intel_llc.c
@@ -29,13 +29,12 @@ static struct intel_gt *llc_to_gt(struct intel_llc *llc)
 
 static unsigned int cpu_max_MHz(void)
 {
-       struct cpufreq_policy *policy;
+       struct cpufreq_policy *policy __free(put_cpufreq_policy);
        unsigned int max_khz;
 
        policy = cpufreq_cpu_get(0);
        if (policy) {
                max_khz = policy->cpuinfo.max_freq;
-               cpufreq_cpu_put(policy);
        } else {
                /*
                 * Default to measured freq if none found, PCU will ensure we
-- 
2.25.1


Reply via email to