Re: [PATCH v3 08/12] cpufreq: powerpc: macintosh: Use scope-based cleanup helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/09/2025 10:57, Zihuan Zhang wrote:
> +	struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(0);
>  	struct wf_control *clamp;
>  	struct device *dev;
>  	int ret;
>  
> -	policy = cpufreq_cpu_get(0);
>  	if (!policy) {
>  		pr_warn("%s: cpufreq policy not found cpu0\n", __func__);
>  		return -EPROBE_DEFER;
> @@ -79,8 +78,6 @@ static int __init wf_cpufreq_clamp_init(void)
>  	ret = freq_qos_add_request(&policy->constraints, &qos_req, FREQ_QOS_MAX,
>  				   max_freq);
>  
> -	cpufreq_cpu_put(policy);
> -
Not much improvement. Previously this was simple code, easy to grasp.
Best regards,
Krzysztof





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux