lkml.org 
[lkml]   [2013]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/21] cpuidle: coupled: don't compare cpu masks unnecessarily
Date
In cpuidle_coupled_register_device() we do following:
if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus)))
coupled->prevent++;

This is only required to be done when we are using 'coupled' from an existing
cpuidle_device and not when we have just done this:

coupled->coupled_cpus = dev->coupled_cpus

So, move this compare statement to the right place.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpuidle/coupled.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index e952936..19a89eb 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -642,6 +642,10 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev)
other_dev = per_cpu(cpuidle_devices, cpu);
if (other_dev && other_dev->coupled) {
coupled = other_dev->coupled;
+
+ if (WARN_ON(!cpumask_equal(&dev->coupled_cpus,
+ &coupled->coupled_cpus)))
+ coupled->prevent++;
goto have_coupled;
}
}
@@ -655,9 +659,6 @@ int cpuidle_coupled_register_device(struct cpuidle_device *dev)

have_coupled:
dev->coupled = coupled;
- if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &coupled->coupled_cpus)))
- coupled->prevent++;
-
cpuidle_coupled_update_online_cpus(coupled);

coupled->refcnt++;
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2013-09-22 03:41    [W:0.280 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site