From: Andrew Morton Date: Wed, 20 Feb 2013 02:13:50 +0000 (+1100) Subject: sched-proc-sched_stat-fails-on-very-very-large-machines-v2-fix-fix X-Git-Tag: next-20130220~1^2~620 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=180b0ee9d0d5578a60e0314586dcd4f5cd592a01;p=karo-tx-linux.git sched-proc-sched_stat-fails-on-very-very-large-machines-v2-fix-fix fix warnings Reported-by: Wu Fengguang Cc: Dave Jones Cc: Ingo Molnar Cc: Nathan Zimmer Cc: Peter Zijlstra Signed-off-by: Andrew Morton --- diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c index fd65d76d5fb8..e036eda1a9c9 100644 --- a/kernel/sched/stats.c +++ b/kernel/sched/stats.c @@ -25,14 +25,13 @@ static int show_schedstat(struct seq_file *seq, void *v) seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION); seq_printf(seq, "timestamp %lu\n", jiffies); } else { - - cpu = (unsigned long)(v - 2); - - struct rq *rq = cpu_rq(cpu); + struct rq *rq; #ifdef CONFIG_SMP struct sched_domain *sd; int dcount = 0; #endif + cpu = (unsigned long)(v - 2); + rq = cpu_rq(cpu); /* runqueue-specific stats */ seq_printf(seq,