diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-09-17 10:25:47 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-09-17 18:50:53 +0200 |
commit | 69f24d1784b631b81a54eb57c49bf46536dd2382 (patch) | |
tree | 93c05469adbeb6bd24ab06b11d5f906a879e2c11 /arch/mips/kernel/idle.c | |
parent | MIPS: Fix accessing to per-cpu data when flushing the cache (diff) | |
download | linux-69f24d1784b631b81a54eb57c49bf46536dd2382.tar.xz linux-69f24d1784b631b81a54eb57c49bf46536dd2382.zip |
MIPS: Optimize current_cpu_type() for better code.
o Move current_cpu_type() to a separate header file
o #ifdefing on supported CPU types lets modern GCC know that certain
code in callers may be discarded ideally turning current_cpu_type() into
a function returning a constant.
o Use current_cpu_type() rather than direct access to struct cpuinfo_mips.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5833/
Diffstat (limited to 'arch/mips/kernel/idle.c')
-rw-r--r-- | arch/mips/kernel/idle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c index 42f8875d2444..f7991d95bff9 100644 --- a/arch/mips/kernel/idle.c +++ b/arch/mips/kernel/idle.c @@ -18,6 +18,7 @@ #include <linux/sched.h> #include <asm/cpu.h> #include <asm/cpu-info.h> +#include <asm/cpu-type.h> #include <asm/idle.h> #include <asm/mipsregs.h> @@ -136,7 +137,7 @@ void __init check_wait(void) return; } - switch (c->cputype) { + switch (current_cpu_type()) { case CPU_R3081: case CPU_R3081E: cpu_wait = r3081_wait; |