hrtimer: Remove unused clock_base_next_timer_safe()
PATCH 1/1 hrtimer: Remove unused clock_base_next_timer_safe()
clock_base_next_timer_safe() was added by commit a64ad57e41c7 ("hrtimer:
Simplify run_hrtimer_queues()") but has never had a caller; the queue iteration in __hrtimer_run_queues() uses clock_base_next_timer() instead.
The two are functionally equivalent: struct hrtimer embeds its timerqueue node at offset 0, so container_of() of a NULL node yields NULL. Thus clock_base_next_timer() already returns NULL on an empty queue and the explicit NULL check in the _safe variant is redundant.
Being a static __always_inline function it does not trigger -Wunused-function, so the dead code has gone unnoticed. Remove it.
No functional change.
--- kernel/time/hrtimer.c | 7 ------- 1 file changed, 7 deletions(-)
kernel/time/hrtimer.c +0 -7
@@ -2060,13 +2060,6 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, struct hrtimer_cloc base->running =NULL ; } -static __always_inline struct hrtimer *clock_base_next_timer_safe(struct hrtimer_clock_base *base) -{ -struct timerqueue_linked_node *next =timerqueue_linked_first (&base->active); - -return next ?hrtimer_from_timerqueue_node (next) :NULL ; -} -static void __hrtimer_run_queues (struct hrtimer_cpu_base *cpu_base,ktime_t now,unsigned long flags,unsigned int active_mask) {
Signature · 1 line
2.43.0
The following commit has been merged into the timers/core branch of tip:
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 034b5779b85b8ce2eacf235f41af15c21d10cf54 Gitweb: https://git.kernel.org/tip/034b5779b85b8ce2eacf235f41af15c21d10cf54 Author: Zhan Xusheng <[email protected]> AuthorDate: Thu, 25 Jun 2026 22:09:01 +08:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 30 Jun 2026 18:55:08 +02:00
hrtimer: Remove unused clock_base_next_timer_safe()
clock_base_next_timer_safe() was added by commit a64ad57e41c7 ("hrtimer:
Simplify run_hrtimer_queues()") but has never had a caller; the queue iteration in __hrtimer_run_queues() uses clock_base_next_timer() instead.
The two are functionally equivalent: struct hrtimer embeds the timerqueue node at offset 0, so container_of() of a NULL node yields NULL. Thus clock_base_next_timer() already returns NULL on an empty queue and the explicit NULL check in the _safe variant is redundant.
Being a static __always_inline function it does not trigger -Wunused-function, so the dead code has gone unnoticed. Remove it.
No functional change.
--- kernel/time/hrtimer.c | 7 ------- 1 file changed, 7 deletions(-)
kernel/time/hrtimer.c +0 -7
@@ -2060,13 +2060,6 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, struct hrtimer_cloc base->running =NULL ; } -static __always_inline struct hrtimer *clock_base_next_timer_safe(struct hrtimer_clock_base *base) -{ -struct timerqueue_linked_node *next =timerqueue_linked_first (&base->active); - -return next ?hrtimer_from_timerqueue_node (next) :NULL ; -} -static void __hrtimer_run_queues (struct hrtimer_cpu_base *cpu_base,ktime_t now,unsigned long flags,unsigned int active_mask) {