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 <hca@linux.ibm.com> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
committed by
Vasily Gorbik
parent
15428734e1
commit
81f907b246
@@ -288,15 +288,16 @@ static void __init test_monitor_call(void)
|
|||||||
|
|
||||||
void __init trap_init(void)
|
void __init trap_init(void)
|
||||||
{
|
{
|
||||||
|
struct lowcore *lc = get_lowcore();
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct ctlreg cr0;
|
struct ctlreg cr0;
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
cr0 = local_ctl_clear_bit(0, CR0_LOW_ADDRESS_PROTECTION_BIT);
|
cr0 = local_ctl_clear_bit(0, CR0_LOW_ADDRESS_PROTECTION_BIT);
|
||||||
psw_bits(get_lowcore()->external_new_psw).mcheck = 1;
|
psw_bits(lc->external_new_psw).mcheck = 1;
|
||||||
psw_bits(get_lowcore()->program_new_psw).mcheck = 1;
|
psw_bits(lc->program_new_psw).mcheck = 1;
|
||||||
psw_bits(get_lowcore()->svc_new_psw).mcheck = 1;
|
psw_bits(lc->svc_new_psw).mcheck = 1;
|
||||||
psw_bits(get_lowcore()->io_new_psw).mcheck = 1;
|
psw_bits(lc->io_new_psw).mcheck = 1;
|
||||||
local_ctl_load(0, &cr0);
|
local_ctl_load(0, &cr0);
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
local_mcck_enable();
|
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)
|
void noinstr __do_pgm_check(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
unsigned int trapnr;
|
struct lowcore *lc = get_lowcore();
|
||||||
irqentry_state_t state;
|
irqentry_state_t state;
|
||||||
|
unsigned int trapnr;
|
||||||
|
|
||||||
regs->int_code = get_lowcore()->pgm_int_code;
|
regs->int_code = lc->pgm_int_code;
|
||||||
regs->int_parm_long = get_lowcore()->trans_exc_code;
|
regs->int_parm_long = lc->trans_exc_code;
|
||||||
|
|
||||||
state = irqentry_enter(regs);
|
state = irqentry_enter(regs);
|
||||||
|
|
||||||
@@ -324,19 +326,19 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
|
|||||||
current->thread.last_break = regs->last_break;
|
current->thread.last_break = regs->last_break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_lowcore()->pgm_code & 0x0200) {
|
if (lc->pgm_code & 0x0200) {
|
||||||
/* transaction abort */
|
/* 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)) {
|
if (user_mode(regs)) {
|
||||||
struct per_event *ev = ¤t->thread.per_event;
|
struct per_event *ev = ¤t->thread.per_event;
|
||||||
|
|
||||||
set_thread_flag(TIF_PER_TRAP);
|
set_thread_flag(TIF_PER_TRAP);
|
||||||
ev->address = get_lowcore()->per_address;
|
ev->address = lc->per_address;
|
||||||
ev->cause = get_lowcore()->per_code_combined;
|
ev->cause = lc->per_code_combined;
|
||||||
ev->paid = get_lowcore()->per_access_id;
|
ev->paid = lc->per_access_id;
|
||||||
} else {
|
} else {
|
||||||
/* PER event in kernel is kprobes */
|
/* PER event in kernel is kprobes */
|
||||||
__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
|
__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
|
||||||
|
Reference in New Issue
Block a user