sched: Fix UP update_avg() build warning
authorMike Galbraith <[email protected]>
Thu, 15 Apr 2010 05:29:59 +0000 (07:29 +0200)
committerIngo Molnar <[email protected]>
Thu, 15 Apr 2010 07:36:47 +0000 (09:36 +0200)
update_avg() is only used for SMP builds, move it to the nearest
SMP block.

Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
LKML-Reference: <1271309399[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched.c

index ab562ae4007c360be41bf3688f44af1c1e759cf4..de0da71daf77d3c1107776501b4f766f7923094b 100644 (file)
@@ -1872,12 +1872,6 @@ static void set_load_weight(struct task_struct *p)
        p->se.load.inv_weight = prio_to_wmult[p->static_prio - MAX_RT_PRIO];
 }
 
-static void update_avg(u64 *avg, u64 sample)
-{
-       s64 diff = sample - *avg;
-       *avg += diff >> 3;
-}
-
 static void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
 {
        update_rq_clock(rq);
@@ -2332,6 +2326,12 @@ int select_task_rq(struct rq *rq, struct task_struct *p, int sd_flags, int wake_
 
        return cpu;
 }
+
+static void update_avg(u64 *avg, u64 sample)
+{
+       s64 diff = sample - *avg;
+       *avg += diff >> 3;
+}
 #endif
 
 /***