diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2021-07-21 13:25:21 +0200 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2021-07-27 09:39:20 +0200 |
commit | 873129ca7b56c7b28dcf712b3bd50c08dc36b910 (patch) | |
tree | 4f4e28c67bde399ad3e6b7dea1e0dba7a9e22a8a | |
parent | s390/hwcaps: move setup_hwcaps() (diff) | |
download | linux-873129ca7b56c7b28dcf712b3bd50c08dc36b910.tar.xz linux-873129ca7b56c7b28dcf712b3bd50c08dc36b910.zip |
s390/hwcaps: split setup_hwcaps()
setup_hwcaps() is a quite large function. Make it smaller by moving
the elf platform setup code into an independent setup function.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r-- | arch/s390/kernel/processor.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index b5569a67ee1d..7517e430b9e8 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -183,7 +183,6 @@ static void show_cpu_summary(struct seq_file *m, void *v) static int __init setup_hwcaps(void) { static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; - struct cpuid cpu_id; int i; /* @@ -278,6 +277,20 @@ static int __init setup_hwcaps(void) if (MACHINE_HAS_PCI_MIO) elf_hwcap |= HWCAP_PCI_MIO; + /* + * Virtualization support HWCAP_INT_SIE is bit 0. + */ + if (sclp.has_sief2) + int_hwcap |= HWCAP_INT_SIE; + + return 0; +} +arch_initcall(setup_hwcaps); + +static int __init setup_elf_platform(void) +{ + struct cpuid cpu_id; + get_cpu_id(&cpu_id); add_device_randomness(&cpu_id, sizeof(cpu_id)); switch (cpu_id.machine) { @@ -319,16 +332,9 @@ static int __init setup_hwcaps(void) strcpy(elf_platform, "z15"); break; } - - /* - * Virtualization support HWCAP_INT_SIE is bit 0. - */ - if (sclp.has_sief2) - int_hwcap |= HWCAP_INT_SIE; - return 0; } -arch_initcall(setup_hwcaps); +arch_initcall(setup_elf_platform); static void show_cpu_topology(struct seq_file *m, unsigned long n) { |