Skip to content

Commit eb28ec2

Browse files
svens-s390Vasily Gorbik
authored andcommitted
s390/smp: Remove duplicate get_lowcore() calls
Assign the output from get_lowcore() to a local variable, so the code is easier to read. Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent d7c3ebc commit eb28ec2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

arch/s390/kernel/smp.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -842,15 +842,16 @@ void __init smp_detect_cpus(void)
842842
*/
843843
static void smp_start_secondary(void *cpuvoid)
844844
{
845+
struct lowcore *lc = get_lowcore();
845846
int cpu = raw_smp_processor_id();
846847

847-
get_lowcore()->last_update_clock = get_tod_clock();
848-
get_lowcore()->restart_stack = (unsigned long)restart_stack;
849-
get_lowcore()->restart_fn = (unsigned long)do_restart;
850-
get_lowcore()->restart_data = 0;
851-
get_lowcore()->restart_source = -1U;
852-
get_lowcore()->restart_flags = 0;
853-
restore_access_regs(get_lowcore()->access_regs_save_area);
848+
lc->last_update_clock = get_tod_clock();
849+
lc->restart_stack = (unsigned long)restart_stack;
850+
lc->restart_fn = (unsigned long)do_restart;
851+
lc->restart_data = 0;
852+
lc->restart_source = -1U;
853+
lc->restart_flags = 0;
854+
restore_access_regs(lc->access_regs_save_area);
854855
cpu_init();
855856
rcutree_report_cpu_starting(cpu);
856857
init_cpu_timer();
@@ -987,10 +988,12 @@ void __init smp_prepare_boot_cpu(void)
987988

988989
void __init smp_setup_processor_id(void)
989990
{
991+
struct lowcore *lc = get_lowcore();
992+
990993
pcpu_devices[0].address = stap();
991-
get_lowcore()->cpu_nr = 0;
992-
get_lowcore()->spinlock_lockval = arch_spin_lockval(0);
993-
get_lowcore()->spinlock_index = 0;
994+
lc->cpu_nr = 0;
995+
lc->spinlock_lockval = arch_spin_lockval(0);
996+
lc->spinlock_index = 0;
994997
}
995998

996999
/*

0 commit comments

Comments
 (0)