[PATCH] timers: Remove get_timer_this_cpu_base()
get_timer_this_cpu_base() and get_timer_cpu_base() have almost identical implementations, so replace the former with the latter. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> --- kernel/time/timer.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 1f2364126894..da1295646d39 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -925,20 +925,6 @@ static inline struct timer_base *get_timer_cpu_base(u32 tflags, u32 cpu) 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; - - /* - * 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)) - index = BASE_DEF; - - return this_cpu_ptr(&timer_bases[index]); -} - static inline struct timer_base *get_timer_base(u32 tflags) { return get_timer_cpu_base(tflags, tflags & TIMER_CPUMASK); @@ -1019,6 +1005,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option { unsigned long clk = 0, flags, bucket_expiry; struct timer_base *base, *new_base; + int cpu = smp_processor_id(); unsigned int idx = UINT_MAX; int ret = 0; @@ -1098,7 +1085,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option if (!ret && (options & MOD_TIMER_PENDING_ONLY)) goto out_unlock; - new_base = get_timer_this_cpu_base(timer->flags); + new_base = get_timer_cpu_base(timer->flags, cpu); if (base != new_base) { /* -- 2.34.1
participants (1)
-
Jinjie Ruan