lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/38] tick-common: call tick_check_percpu() from tick_check_preferred()
Date
tick_check_percpu() and tick_check_preferred() are called from two places and in
exactly same order. So, would make sense to call tick_check_percpu() from
tick_check_preferred() instead, so that their common caller can just call
tick_check_preferred().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/time/tick-common.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 8650026..6868d6a 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -233,6 +233,9 @@ static bool tick_check_percpu(struct clock_event_device *curdev,
static bool tick_check_preferred(struct clock_event_device *curdev,
struct clock_event_device *newdev)
{
+ if (!tick_check_percpu(curdev, newdev, smp_processor_id()))
+ return false;
+
/* Prefer oneshot capable device */
if (!(newdev->features & CLOCK_EVT_FEAT_ONESHOT)) {
if (curdev && (curdev->features & CLOCK_EVT_FEAT_ONESHOT))
@@ -257,9 +260,6 @@ static bool tick_check_preferred(struct clock_event_device *curdev,
bool tick_check_replacement(struct clock_event_device *curdev,
struct clock_event_device *newdev)
{
- if (!tick_check_percpu(curdev, newdev, smp_processor_id()))
- return false;
-
return tick_check_preferred(curdev, newdev);
}

@@ -273,10 +273,6 @@ void tick_check_new_device(struct clock_event_device *newdev)
struct tick_device *td = tick_get_device(cpu);
struct clock_event_device *curdev = td->evtdev;

- /* cpu local device ? */
- if (!tick_check_percpu(curdev, newdev, cpu))
- goto out_bc;
-
/* Preference decision */
if (!tick_check_preferred(curdev, newdev))
goto out_bc;
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-04-14 23:41    [W:0.130 / U:43.584 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site