diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-30 10:15:55 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-31 17:20:55 +0200 |
commit | 56b906126d33904d4d67615d0d5b95dbdf1f27ca (patch) | |
tree | 49ff0678cbb0f388fc5fd42e71ec5916fd655193 /kernel/sched_clock.c | |
parent | sched: eliminate scd->prev_raw (diff) | |
download | linux-56b906126d33904d4d67615d0d5b95dbdf1f27ca.tar.xz linux-56b906126d33904d4d67615d0d5b95dbdf1f27ca.zip |
sched clock: simplify __update_sched_clock()
- return the current clock instead of letting callers
fetch it from scd->clock
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Mike Galbraith <efault@gmx.de>
Diffstat (limited to 'kernel/sched_clock.c')
-rw-r--r-- | kernel/sched_clock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index 4b8474c966dc..857a1291fd23 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c @@ -97,7 +97,7 @@ void sched_clock_init(void) * - filter out backward motion * - use jiffies to generate a min,max window to clip the raw values */ -static void __update_sched_clock(struct sched_clock_data *scd, u64 now) +static u64 __update_sched_clock(struct sched_clock_data *scd, u64 now) { unsigned long now_jiffies = jiffies; long delta_jiffies = now_jiffies - scd->tick_jiffies; @@ -130,6 +130,8 @@ static void __update_sched_clock(struct sched_clock_data *scd, u64 now) scd->tick_jiffies = now_jiffies; scd->clock = clock; + + return clock; } static void lock_double_clock(struct sched_clock_data *data1, @@ -174,8 +176,7 @@ u64 sched_clock_cpu(int cpu) __raw_spin_lock(&scd->lock); } - __update_sched_clock(scd, now); - clock = scd->clock; + clock = __update_sched_clock(scd, now); __raw_spin_unlock(&scd->lock); |