Re: [PATCH] cpufreq: governor: Drop pointless goto from cpufreq_governor_init()

From: Viresh Kumar
Date: Mon Feb 08 2016 - 22:50:42 EST


On 08-02-16, 23:57, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> It is silly to jump around "return 0", so don't do that.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
>
> On top of the bleeding-edge branch of linux-pm.git.
>
> Thanks,
> Rafael
>
> ---
> drivers/cpufreq/cpufreq_governor.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/cpufreq_governor.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/cpufreq_governor.c
> +++ linux-pm/drivers/cpufreq/cpufreq_governor.c
> @@ -394,12 +394,11 @@ static int cpufreq_governor_init(struct
>
> ret = sysfs_create_group(get_governor_parent_kobj(policy),
> get_sysfs_attr(gov));
> - if (ret)
> - goto reset_gdbs_data;
> + if (!ret)
> + return 0;
>
> - return 0;
> + /* Failure, so roll back. */
>
> -reset_gdbs_data:
> policy->governor_data = NULL;
>
> if (!have_governor_per_policy())

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

--
viresh