diff options
author | Robert Millan <rmh@gnu.org> | 2011-04-18 20:37:55 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-05-19 10:55:48 +0200 |
commit | c094c99e659efedcbb05a0f75b8f77145d8ec539 (patch) | |
tree | 92044a50986f7b56c4270273b2040f04041ca92e /arch/mips | |
parent | MIPS: JZ4740: setup: Autodetect physical memory. (diff) | |
download | linux-c094c99e659efedcbb05a0f75b8f77145d8ec539.tar.xz linux-c094c99e659efedcbb05a0f75b8f77145d8ec539.zip |
MIPS: Introduce set_elf_platform() helper function
Replace these sequences:
if (cpu == 0)
__elf_platform = "foo";
with a trivial inline function.
Signed-off-by: Robert Millan <rmh@gnu.org>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David 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: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index c7b7eb24e277..aa86250844ca 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -291,6 +291,12 @@ static inline int cpu_has_confreg(void) #endif } +static inline void set_elf_platform(int cpu, const char *plat) +{ + if (cpu == 0) + __elf_platform = plat; +} + /* * Get the FPU Implementation/Revision. */ @@ -956,14 +962,12 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) c->cputype = CPU_CAVIUM_OCTEON_PLUS; __cpu_name[cpu] = "Cavium Octeon+"; platform: - if (cpu == 0) - __elf_platform = "octeon"; + set_elf_platform(cpu, "octeon"); break; case PRID_IMP_CAVIUM_CN63XX: c->cputype = CPU_CAVIUM_OCTEON2; __cpu_name[cpu] = "Cavium Octeon II"; - if (cpu == 0) - __elf_platform = "octeon2"; + set_elf_platform(cpu, "octeon2"); break; default: printk(KERN_INFO "Unknown Octeon chip!\n"); |