Skip to content

Commit 1542873

Browse files
svens-s390Vasily Gorbik
authored andcommitted
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 <[email protected]> Signed-off-by: Sven Schnelle <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 46c3031 commit 1542873

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arch/s390/kernel/idle.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ static DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
2424
void account_idle_time_irq(void)
2525
{
2626
struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
27+
struct lowcore *lc = get_lowcore();
2728
unsigned long idle_time;
2829
u64 cycles_new[8];
2930
int i;
@@ -34,13 +35,13 @@ void account_idle_time_irq(void)
3435
this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
3536
}
3637

37-
idle_time = get_lowcore()->int_clock - idle->clock_idle_enter;
38+
idle_time = lc->int_clock - idle->clock_idle_enter;
3839

39-
get_lowcore()->steal_timer += idle->clock_idle_enter - get_lowcore()->last_update_clock;
40-
get_lowcore()->last_update_clock = get_lowcore()->int_clock;
40+
lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock;
41+
lc->last_update_clock = lc->int_clock;
4142

42-
get_lowcore()->system_timer += get_lowcore()->last_update_timer - idle->timer_idle_enter;
43-
get_lowcore()->last_update_timer = get_lowcore()->sys_enter_timer;
43+
lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
44+
lc->last_update_timer = lc->sys_enter_timer;
4445

4546
/* Account time spent with enabled wait psw loaded as idle time. */
4647
WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);

0 commit comments

Comments
 (0)