Skip to content

Commit 81f907b

Browse files
svens-s390Vasily Gorbik
authored andcommitted
s390/mm: 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 1542873 commit 81f907b

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

arch/s390/kernel/traps.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,16 @@ static void __init test_monitor_call(void)
288288

289289
void __init trap_init(void)
290290
{
291+
struct lowcore *lc = get_lowcore();
291292
unsigned long flags;
292293
struct ctlreg cr0;
293294

294295
local_irq_save(flags);
295296
cr0 = local_ctl_clear_bit(0, CR0_LOW_ADDRESS_PROTECTION_BIT);
296-
psw_bits(get_lowcore()->external_new_psw).mcheck = 1;
297-
psw_bits(get_lowcore()->program_new_psw).mcheck = 1;
298-
psw_bits(get_lowcore()->svc_new_psw).mcheck = 1;
299-
psw_bits(get_lowcore()->io_new_psw).mcheck = 1;
297+
psw_bits(lc->external_new_psw).mcheck = 1;
298+
psw_bits(lc->program_new_psw).mcheck = 1;
299+
psw_bits(lc->svc_new_psw).mcheck = 1;
300+
psw_bits(lc->io_new_psw).mcheck = 1;
300301
local_ctl_load(0, &cr0);
301302
local_irq_restore(flags);
302303
local_mcck_enable();
@@ -307,11 +308,12 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
307308

308309
void noinstr __do_pgm_check(struct pt_regs *regs)
309310
{
310-
unsigned int trapnr;
311+
struct lowcore *lc = get_lowcore();
311312
irqentry_state_t state;
313+
unsigned int trapnr;
312314

313-
regs->int_code = get_lowcore()->pgm_int_code;
314-
regs->int_parm_long = get_lowcore()->trans_exc_code;
315+
regs->int_code = lc->pgm_int_code;
316+
regs->int_parm_long = lc->trans_exc_code;
315317

316318
state = irqentry_enter(regs);
317319

@@ -324,19 +326,19 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
324326
current->thread.last_break = regs->last_break;
325327
}
326328

327-
if (get_lowcore()->pgm_code & 0x0200) {
329+
if (lc->pgm_code & 0x0200) {
328330
/* transaction abort */
329-
current->thread.trap_tdb = get_lowcore()->pgm_tdb;
331+
current->thread.trap_tdb = lc->pgm_tdb;
330332
}
331333

332-
if (get_lowcore()->pgm_code & PGM_INT_CODE_PER) {
334+
if (lc->pgm_code & PGM_INT_CODE_PER) {
333335
if (user_mode(regs)) {
334336
struct per_event *ev = &current->thread.per_event;
335337

336338
set_thread_flag(TIF_PER_TRAP);
337-
ev->address = get_lowcore()->per_address;
338-
ev->cause = get_lowcore()->per_code_combined;
339-
ev->paid = get_lowcore()->per_access_id;
339+
ev->address = lc->per_address;
340+
ev->cause = lc->per_code_combined;
341+
ev->paid = lc->per_access_id;
340342
} else {
341343
/* PER event in kernel is kprobes */
342344
__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);

0 commit comments

Comments
 (0)