[PATCH 03/17] treewide, timers: Rename add_timer_global() => timer_add_global()

Ingo Molnar
2025-04-14T10:23:16Z

Move this API to the canonical timer_*() namespace.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
include/linux/timer.h | 2 +-
kernel/time/timer.c | 8 ++++----
kernel/workqueue.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/timer.h b/include/linux/timer.h
index 10596d7c3a34..d35d3f27a987 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -160,7 +160,7 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires);

extern void add_timer(struct timer_list *timer);
extern void add_timer_local(struct timer_list *timer);
-extern void add_timer_global(struct timer_list *timer);
+extern void timer_add_global(struct timer_list *timer);

extern int try_to_del_timer_sync(struct timer_list *timer);
extern int timer_delete_sync(struct timer_list *timer);
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 4d915c0a263c..47165b16380a 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1310,21 +1310,21 @@ void add_timer_local(struct timer_list *timer)
EXPORT_SYMBOL(add_timer_local);

/**
- * add_timer_global() - Start a timer without TIMER_PINNED flag set
+ * timer_add_global() - Start a timer without TIMER_PINNED flag set
* @timer: The timer to be started
*
* Same as add_timer() except that the timer flag TIMER_PINNED is unset.
*
* See add_timer() for further details.
*/
-void add_timer_global(struct timer_list *timer)
+void timer_add_global(struct timer_list *timer)
{
if (WARN_ON_ONCE(timer_pending(timer)))
return;
timer->flags &= ~TIMER_PINNED;
__mod_timer(timer, timer->expires, MOD_TIMER_NOTPENDING);
}
-EXPORT_SYMBOL(add_timer_global);
+EXPORT_SYMBOL(timer_add_global);

/**
* add_timer_on - Start a timer on a particular CPU
@@ -1333,7 +1333,7 @@ EXPORT_SYMBOL(add_timer_global);
*
* Same as add_timer() except that it starts the timer on the given CPU and
* the TIMER_PINNED flag is set. When timer shouldn't be a pinned timer in
- * the next round, add_timer_global() should be used instead as it unsets
+ * the next round, timer_add_global() should be used instead as it unsets
* the TIMER_PINNED flag.
*
* See add_timer() for further details.
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cf6203282737..b0e53d3e56c7 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2523,7 +2523,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
add_timer_on(timer, cpu);
} else {
if (likely(cpu == WORK_CPU_UNBOUND))
- add_timer_global(timer);
+ timer_add_global(timer);
else
add_timer_on(timer, cpu);
}
--
2.45.2