Skip to content

Commit

Permalink
sched clock: simplify __update_sched_clock()
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Ingo Molnar committed Jul 31, 2008
1 parent 18e4e36 commit 56b9061
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/sched_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 56b9061

Please sign in to comment.