Re: [PATCH v1 03/10] cpufreq: Split cpufreq_online()

Viresh Kumar
2025-04-01T08:38:57Z

On 28-03-25, 21:41, Rafael J. Wysocki wrote:
>
> +out_unlock:
> up_write(&policy->rwsem);
>
> + return ret;
> +
> +out_destroy_policy:
> + for_each_cpu(j, policy->real_cpus)
> + remove_cpu_dev_symlink(policy, j, get_cpu_device(j));
> +
> +out_offline_policy:
> + if (cpufreq_driver->offline)
> + cpufreq_driver->offline(policy);
> +
> +out_exit_policy:
> + if (cpufreq_driver->exit)
> + cpufreq_driver->exit(policy);
> +
> +out_clear_policy:
> + cpumask_clear(policy->cpus);
> +
> + goto out_unlock;

Instead of jumping back to the function, won't declaring the label here and
jumping from the earlier code to the end of function more readable ?

goto out_unlock;

out_destroy_policy:
for_each_cpu(j, policy->real_cpus)
remove_cpu_dev_symlink(policy, j, get_cpu_device(j));

out_offline_policy:
if (cpufreq_driver->offline)
cpufreq_driver->offline(policy);

out_exit_policy:
if (cpufreq_driver->exit)
cpufreq_driver->exit(policy);

out_clear_policy:
cpumask_clear(policy->cpus);

out_unlock:
up_write(&policy->rwsem);
return ret;

Either ways:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

--
viresh