]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/mm: Remove duplicate get_lowcore() calls
authorSven Schnelle <svens@linux.ibm.com>
Mon, 10 Jun 2024 11:45:32 +0000 (13:45 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 18 Jun 2024 15:01:33 +0000 (17:01 +0200)
Assign the output from get_lowcore() to a local variable,
so the code is easier to read.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/traps.c

index 8b904f7efb0e3bd5dc4b8e75b9168c045f60f07e..a7c211a3a0c95b526c3debd57683661cc942ba2e 100644 (file)
@@ -288,15 +288,16 @@ static void __init test_monitor_call(void)
 
 void __init trap_init(void)
 {
+       struct lowcore *lc = get_lowcore();
        unsigned long flags;
        struct ctlreg cr0;
 
        local_irq_save(flags);
        cr0 = local_ctl_clear_bit(0, CR0_LOW_ADDRESS_PROTECTION_BIT);
-       psw_bits(get_lowcore()->external_new_psw).mcheck = 1;
-       psw_bits(get_lowcore()->program_new_psw).mcheck = 1;
-       psw_bits(get_lowcore()->svc_new_psw).mcheck = 1;
-       psw_bits(get_lowcore()->io_new_psw).mcheck = 1;
+       psw_bits(lc->external_new_psw).mcheck = 1;
+       psw_bits(lc->program_new_psw).mcheck = 1;
+       psw_bits(lc->svc_new_psw).mcheck = 1;
+       psw_bits(lc->io_new_psw).mcheck = 1;
        local_ctl_load(0, &cr0);
        local_irq_restore(flags);
        local_mcck_enable();
@@ -307,11 +308,12 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
 
 void noinstr __do_pgm_check(struct pt_regs *regs)
 {
-       unsigned int trapnr;
+       struct lowcore *lc = get_lowcore();
        irqentry_state_t state;
+       unsigned int trapnr;
 
-       regs->int_code = get_lowcore()->pgm_int_code;
-       regs->int_parm_long = get_lowcore()->trans_exc_code;
+       regs->int_code = lc->pgm_int_code;
+       regs->int_parm_long = lc->trans_exc_code;
 
        state = irqentry_enter(regs);
 
@@ -324,19 +326,19 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
                current->thread.last_break = regs->last_break;
        }
 
-       if (get_lowcore()->pgm_code & 0x0200) {
+       if (lc->pgm_code & 0x0200) {
                /* transaction abort */
-               current->thread.trap_tdb = get_lowcore()->pgm_tdb;
+               current->thread.trap_tdb = lc->pgm_tdb;
        }
 
-       if (get_lowcore()->pgm_code & PGM_INT_CODE_PER) {
+       if (lc->pgm_code & PGM_INT_CODE_PER) {
                if (user_mode(regs)) {
                        struct per_event *ev = &current->thread.per_event;
 
                        set_thread_flag(TIF_PER_TRAP);
-                       ev->address = get_lowcore()->per_address;
-                       ev->cause = get_lowcore()->per_code_combined;
-                       ev->paid = get_lowcore()->per_access_id;
+                       ev->address = lc->per_address;
+                       ev->cause = lc->per_code_combined;
+                       ev->paid = lc->per_access_id;
                } else {
                        /* PER event in kernel is kprobes */
                        __arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);