Commit 15428734 authored by Sven Schnelle's avatar Sven Schnelle Committed by Vasily Gorbik

s390/idle: Remove duplicate get_lowcore() calls

Assign the output from get_lowcore() to a local variable,
so the code is easier to read.
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 46c30311
......@@ -24,6 +24,7 @@ static DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
void account_idle_time_irq(void)
{
struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
struct lowcore *lc = get_lowcore();
unsigned long idle_time;
u64 cycles_new[8];
int i;
......@@ -34,13 +35,13 @@ void account_idle_time_irq(void)
this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
}
idle_time = get_lowcore()->int_clock - idle->clock_idle_enter;
idle_time = lc->int_clock - idle->clock_idle_enter;
get_lowcore()->steal_timer += idle->clock_idle_enter - get_lowcore()->last_update_clock;
get_lowcore()->last_update_clock = get_lowcore()->int_clock;
lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock;
lc->last_update_clock = lc->int_clock;
get_lowcore()->system_timer += get_lowcore()->last_update_timer - idle->timer_idle_enter;
get_lowcore()->last_update_timer = get_lowcore()->sys_enter_timer;
lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
lc->last_update_timer = lc->sys_enter_timer;
/* Account time spent with enabled wait psw loaded as idle time. */
WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment