Commit c094c99e authored by Robert Millan's avatar Robert Millan Committed by Ralf Baechle

MIPS: Introduce set_elf_platform() helper function

Replace these sequences:

if (cpu == 0)
	__elf_platform = "foo";

with a trivial inline function.
Signed-off-by: default avatarRobert Millan <rmh@gnu.org>
Signed-off-by: default avatarKevin Cernekee <cernekee@gmail.com>
Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
Cc: wu zhangjin <wuzhangjin@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2304/
Patchwork: https://patchwork.linux-mips.org/patch/2374/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 6edde024
...@@ -291,6 +291,12 @@ static inline int cpu_has_confreg(void) ...@@ -291,6 +291,12 @@ static inline int cpu_has_confreg(void)
#endif #endif
} }
static inline void set_elf_platform(int cpu, const char *plat)
{
if (cpu == 0)
__elf_platform = plat;
}
/* /*
* Get the FPU Implementation/Revision. * Get the FPU Implementation/Revision.
*/ */
...@@ -956,14 +962,12 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) ...@@ -956,14 +962,12 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
c->cputype = CPU_CAVIUM_OCTEON_PLUS; c->cputype = CPU_CAVIUM_OCTEON_PLUS;
__cpu_name[cpu] = "Cavium Octeon+"; __cpu_name[cpu] = "Cavium Octeon+";
platform: platform:
if (cpu == 0) set_elf_platform(cpu, "octeon");
__elf_platform = "octeon";
break; break;
case PRID_IMP_CAVIUM_CN63XX: case PRID_IMP_CAVIUM_CN63XX:
c->cputype = CPU_CAVIUM_OCTEON2; c->cputype = CPU_CAVIUM_OCTEON2;
__cpu_name[cpu] = "Cavium Octeon II"; __cpu_name[cpu] = "Cavium Octeon II";
if (cpu == 0) set_elf_platform(cpu, "octeon2");
__elf_platform = "octeon2";
break; break;
default: default:
printk(KERN_INFO "Unknown Octeon chip!\n"); printk(KERN_INFO "Unknown Octeon chip!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment