lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 16 May 2016 16:40:19 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	"Pankaj Gupta (Pankaj Gupta)" <Pankaj.Gupta@...eadtrum.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Saravana Kannan <skannan@...eaurora.org>,
	Yinghai Lu <yinghai@...nel.org>
Subject: Re: [PATCH] driver: cpufreq: simplified goto out in
 cpufreq_register_driver

On 16-05-16, 11:07, Pankaj Gupta (Pankaj Gupta) wrote:
> simplified goto out in cpufreq_register_driver for increasing
> code readability
> 
> Signed-off-by: Pankaj Gupta <pankaj.gupta@...eadtrum.com>
> Signed-off-by: Sanjeev Yadav <sanjeev.yadav@...eadtrum.com>
> ---
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index b87596b..0bc23f6 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2370,10 +2370,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>  
>  	register_hotcpu_notifier(&cpufreq_cpu_notifier);
>  	pr_debug("driver %s up and running\n", driver_data->name);
> -
> -out:
> -	put_online_cpus();
> -	return ret;
> +	goto out;
>  
>  err_if_unreg:
>  	subsys_interface_unregister(&cpufreq_interface);
> @@ -2383,7 +2380,9 @@ err_null_driver:
>  	write_lock_irqsave(&cpufreq_driver_lock, flags);
>  	cpufreq_driver = NULL;
>  	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> -	goto out;
> +out:
> +	put_online_cpus();
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(cpufreq_register_driver);

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

-- 
viresh

Powered by blists - more mailing lists