cpufreq: Don't update new_policy on failures

Message ID af05a5d2d3ef76402f54448a66cbd20ee98bceb8.1546844324.git.viresh.kumar@linaro.org
State New
Headers show
Series
  • cpufreq: Don't update new_policy on failures
Related show

Commit Message

Viresh Kumar Jan. 7, 2019, 6:58 a.m.
The local variable "new_policy" isn't getting used in the error path
since the commit f9f41e3ef99a ("cpufreq: Remove policy create/remove
notifiers"). Don't update it in error path.

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

---
 drivers/cpufreq/cpufreq.c | 2 --
 1 file changed, 2 deletions(-)

-- 
2.19.1.568.g152ad8e3369a

Comments

Rafael J. Wysocki Jan. 16, 2019, 11:57 a.m. | #1
On Monday, January 7, 2019 7:58:54 AM CET Viresh Kumar wrote:
> The local variable "new_policy" isn't getting used in the error path

> since the commit f9f41e3ef99a ("cpufreq: Remove policy create/remove

> notifiers"). Don't update it in error path.

> 

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

> ---

>  drivers/cpufreq/cpufreq.c | 2 --

>  1 file changed, 2 deletions(-)

> 

> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c

> index 7aa3dcad2175..9a5f82ef40e8 100644

> --- a/drivers/cpufreq/cpufreq.c

> +++ b/drivers/cpufreq/cpufreq.c

> @@ -1305,8 +1305,6 @@ static int cpufreq_online(unsigned int cpu)

>  	if (ret) {

>  		pr_err("%s: Failed to initialize policy for cpu: %d (%d)\n",

>  		       __func__, cpu, ret);

> -		/* cpufreq_policy_free() will notify based on this */

> -		new_policy = false;

>  		goto out_destroy_policy;

>  	}

>  

> 


Applied, thanks!

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7aa3dcad2175..9a5f82ef40e8 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1305,8 +1305,6 @@  static int cpufreq_online(unsigned int cpu)
 	if (ret) {
 		pr_err("%s: Failed to initialize policy for cpu: %d (%d)\n",
 		       __func__, cpu, ret);
-		/* cpufreq_policy_free() will notify based on this */
-		new_policy = false;
 		goto out_destroy_policy;
 	}