static inline struct timer_base *get_timer_cpu_base(u32 tflags, u32 cpu)
 {
        int index = tflags & TIMER_PINNED ? BASE_LOCAL : BASE_GLOBAL;
-       struct timer_base *base;
-
-       base = per_cpu_ptr(&timer_bases[index], cpu);
 
        /*
         * If the timer is deferrable and NO_HZ_COMMON is set then we need
         * to use the deferrable base.
         */
        if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE))
-               base = per_cpu_ptr(&timer_bases[BASE_DEF], cpu);
-       return base;
+               index = BASE_DEF;
+
+       return per_cpu_ptr(&timer_bases[index], cpu);
 }
 
 static inline struct timer_base *get_timer_this_cpu_base(u32 tflags)
 {
        int index = tflags & TIMER_PINNED ? BASE_LOCAL : BASE_GLOBAL;
-       struct timer_base *base;
-
-       base = this_cpu_ptr(&timer_bases[index]);
 
        /*
         * If the timer is deferrable and NO_HZ_COMMON is set then we need
         * to use the deferrable base.
         */
        if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE))
-               base = this_cpu_ptr(&timer_bases[BASE_DEF]);
-       return base;
+               index = BASE_DEF;
+
+       return this_cpu_ptr(&timer_bases[index]);
 }
 
 static inline struct timer_base *get_timer_base(u32 tflags)