]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/idle: Remove duplicate get_lowcore() calls
authorSven Schnelle <svens@linux.ibm.com>
Mon, 10 Jun 2024 11:45:31 +0000 (13:45 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 18 Jun 2024 15:01:33 +0000 (17:01 +0200)
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>
arch/s390/kernel/idle.c

index 2c34e02ae64ba823764c34a976897a05b312992d..39cb8d0ae3480647911f05b833bcc6c015ccfc69 100644 (file)
@@ -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);