MIPS: Use current_cpu_type() instead of c->cputype
authorWu Zhangjin <wuzhangjin@gmail.com>
Sat, 25 Dec 2010 20:42:37 +0000 (04:42 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 31 Mar 2014 16:17:12 +0000 (18:17 +0200)
If current_cpu_type() is pre-defined in cpu-feature-overrides.h, This
may save about 10k for the compressed kernel image(vmlinuz).

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1901/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/cpu.c
arch/mips/kernel/spram.c
arch/mips/mm/tlbex.c

index 1b1b8a89959bb1f3998726f83675de7f9cde0784..fd4e76c00a42d44dfdd638e18861f53b41c76218 100644 (file)
@@ -299,14 +299,13 @@ static unsigned int detect_memory_size(void)
 void __init bcm63xx_cpu_init(void)
 {
        unsigned int tmp;
-       struct cpuinfo_mips *c = &current_cpu_data;
        unsigned int cpu = smp_processor_id();
        u32 chipid_reg;
 
        /* soc registers location depends on cpu type */
        chipid_reg = 0;
 
-       switch (c->cputype) {
+       switch (current_cpu_type()) {
        case CPU_BMIPS3300:
                if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
                        __cpu_name[cpu] = "Broadcom BCM6338";
index f9a693a6aaa742208c9b549b0fbf86a0d339ab2a..67f2495def1cd18615210c32e2cc111ea66c8fe0 100644 (file)
@@ -197,10 +197,9 @@ static void probe_spram(char *type,
 }
 void spram_config(void)
 {
-       struct cpuinfo_mips *c = &current_cpu_data;
        unsigned int config0;
 
-       switch (c->cputype) {
+       switch (current_cpu_type()) {
        case CPU_24K:
        case CPU_34K:
        case CPU_74K:
index be407d5ccc4e3cf6d8aa5eb1ca79f124056af764..6e5c9fda72c9a19032821ac096ef9d20c461d2a2 100644 (file)
@@ -624,7 +624,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
 
        default:
                panic("No TLB refill handler yet (CPU type: %d)",
-                     current_cpu_data.cputype);
+                     current_cpu_type());
                break;
        }
 }