Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7b12056 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle
Browse files

MIPS: Use current_cpu_type() instead of c->cputype



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: default avatarWu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/1901/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 1bc021e8
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -299,14 +299,13 @@ static unsigned int detect_memory_size(void)
void __init bcm63xx_cpu_init(void)
void __init bcm63xx_cpu_init(void)
{
{
	unsigned int tmp;
	unsigned int tmp;
	struct cpuinfo_mips *c = &current_cpu_data;
	unsigned int cpu = smp_processor_id();
	unsigned int cpu = smp_processor_id();
	u32 chipid_reg;
	u32 chipid_reg;


	/* soc registers location depends on cpu type */
	/* soc registers location depends on cpu type */
	chipid_reg = 0;
	chipid_reg = 0;


	switch (c->cputype) {
	switch (current_cpu_type()) {
	case CPU_BMIPS3300:
	case CPU_BMIPS3300:
		if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
		if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
			__cpu_name[cpu] = "Broadcom BCM6338";
			__cpu_name[cpu] = "Broadcom BCM6338";
+1 −2
Original line number Original line Diff line number Diff line
@@ -197,10 +197,9 @@ static void probe_spram(char *type,
}
}
void spram_config(void)
void spram_config(void)
{
{
	struct cpuinfo_mips *c = &current_cpu_data;
	unsigned int config0;
	unsigned int config0;


	switch (c->cputype) {
	switch (current_cpu_type()) {
	case CPU_24K:
	case CPU_24K:
	case CPU_34K:
	case CPU_34K:
	case CPU_74K:
	case CPU_74K:
+1 −1
Original line number Original line Diff line number Diff line
@@ -624,7 +624,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,


	default:
	default:
		panic("No TLB refill handler yet (CPU type: %d)",
		panic("No TLB refill handler yet (CPU type: %d)",
		      current_cpu_data.cputype);
		      current_cpu_type());
		break;
		break;
	}
	}
}
}