Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Sven Schnelle and committed by
Vasily Gorbik
15428734 46c30311

+6 -5
+6 -5
arch/s390/kernel/idle.c
··· 24 24 void account_idle_time_irq(void) 25 25 { 26 26 struct s390_idle_data *idle = this_cpu_ptr(&s390_idle); 27 + struct lowcore *lc = get_lowcore(); 27 28 unsigned long idle_time; 28 29 u64 cycles_new[8]; 29 30 int i; ··· 35 34 this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); 36 35 } 37 36 38 - idle_time = get_lowcore()->int_clock - idle->clock_idle_enter; 37 + idle_time = lc->int_clock - idle->clock_idle_enter; 39 38 40 - get_lowcore()->steal_timer += idle->clock_idle_enter - get_lowcore()->last_update_clock; 41 - get_lowcore()->last_update_clock = get_lowcore()->int_clock; 39 + lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock; 40 + lc->last_update_clock = lc->int_clock; 42 41 43 - get_lowcore()->system_timer += get_lowcore()->last_update_timer - idle->timer_idle_enter; 44 - get_lowcore()->last_update_timer = get_lowcore()->sys_enter_timer; 42 + lc->system_timer += lc->last_update_timer - idle->timer_idle_enter; 43 + lc->last_update_timer = lc->sys_enter_timer; 45 44 46 45 /* Account time spent with enabled wait psw loaded as idle time. */ 47 46 WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);