From 49916e22d9530d6cf027e635a5d824c7d698d67f Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Fri, 18 Apr 2025 21:08:03 +0100 Subject: timers: Remove unused __round_jiffies(_up) Remove two trivial but long unused functions. __round_jiffies() has been unused since 2008's commit 9c133c469d38 ("Add round_jiffies_up and related routines") __round_jiffies_up() has been unused since 2019's commit 7ae3f6e130e8 ("powerpc/watchdog: Use hrtimers for per-CPU heartbeat") Remove them. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250418200803.427911-1-linux@treblig.org --- include/linux/timer.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 10596d7c3a34..e17aac74b5b3 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -172,12 +172,10 @@ extern void init_timers(void); struct hrtimer; extern enum hrtimer_restart it_real_fn(struct hrtimer *); -unsigned long __round_jiffies(unsigned long j, int cpu); unsigned long __round_jiffies_relative(unsigned long j, int cpu); unsigned long round_jiffies(unsigned long j); unsigned long round_jiffies_relative(unsigned long j); -unsigned long __round_jiffies_up(unsigned long j, int cpu); unsigned long __round_jiffies_up_relative(unsigned long j, int cpu); unsigned long round_jiffies_up(unsigned long j); unsigned long round_jiffies_up_relative(unsigned long j); -- cgit v1.2.3 From e86e43907f945e7f2e48d1c5c9105801ca2b11b7 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:30 +0200 Subject: timers: Rename init_timer_key() as timer_init_key() Move this API to the canonical timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-3-mingo@kernel.org --- include/linux/timer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 10596d7c3a34..0c1c3aa723e5 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -67,7 +67,7 @@ /* * LOCKDEP and DEBUG timer interfaces. */ -void init_timer_key(struct timer_list *timer, +void timer_init_key(struct timer_list *timer, void (*func)(struct timer_list *), unsigned int flags, const char *name, struct lock_class_key *key); @@ -83,7 +83,7 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, const char *name, struct lock_class_key *key) { - init_timer_key(timer, func, flags, name, key); + timer_init_key(timer, func, flags, name, key); } #endif @@ -91,7 +91,7 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, #define __init_timer(_timer, _fn, _flags) \ do { \ static struct lock_class_key __key; \ - init_timer_key((_timer), (_fn), (_flags), #_timer, &__key);\ + timer_init_key((_timer), (_fn), (_flags), #_timer, &__key);\ } while (0) #define __init_timer_on_stack(_timer, _fn, _flags) \ @@ -102,7 +102,7 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, } while (0) #else #define __init_timer(_timer, _fn, _flags) \ - init_timer_key((_timer), (_fn), (_flags), NULL, NULL) + timer_init_key((_timer), (_fn), (_flags), NULL, NULL) #define __init_timer_on_stack(_timer, _fn, _flags) \ init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL) #endif -- cgit v1.2.3 From 7879d10de3318af0b7893d1efc9d7654cd4ac1a6 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:31 +0200 Subject: timers: Rename init_timer_on_stack_key() as timer_init_key_on_stack() Move this API to the canonical timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-4-mingo@kernel.org --- include/linux/timer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 0c1c3aa723e5..31127e8de010 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -72,12 +72,12 @@ void timer_init_key(struct timer_list *timer, const char *name, struct lock_class_key *key); #ifdef CONFIG_DEBUG_OBJECTS_TIMERS -extern void init_timer_on_stack_key(struct timer_list *timer, +extern void timer_init_key_on_stack(struct timer_list *timer, void (*func)(struct timer_list *), unsigned int flags, const char *name, struct lock_class_key *key); #else -static inline void init_timer_on_stack_key(struct timer_list *timer, +static inline void timer_init_key_on_stack(struct timer_list *timer, void (*func)(struct timer_list *), unsigned int flags, const char *name, @@ -97,14 +97,14 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, #define __init_timer_on_stack(_timer, _fn, _flags) \ do { \ static struct lock_class_key __key; \ - init_timer_on_stack_key((_timer), (_fn), (_flags), \ + timer_init_key_on_stack((_timer), (_fn), (_flags), \ #_timer, &__key); \ } while (0) #else #define __init_timer(_timer, _fn, _flags) \ timer_init_key((_timer), (_fn), (_flags), NULL, NULL) #define __init_timer_on_stack(_timer, _fn, _flags) \ - init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL) + timer_init_key_on_stack((_timer), (_fn), (_flags), NULL, NULL) #endif /** -- cgit v1.2.3 From 9505215b6b3233d38c5ee65cfd47b6a5a36adab9 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:32 +0200 Subject: timers: Rename __init_timer() as __timer_init() Move this API to the canonical __timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-5-mingo@kernel.org --- include/linux/timer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 31127e8de010..11e1fac18f0e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -88,7 +88,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, #endif #ifdef CONFIG_LOCKDEP -#define __init_timer(_timer, _fn, _flags) \ +#define __timer_init(_timer, _fn, _flags) \ do { \ static struct lock_class_key __key; \ timer_init_key((_timer), (_fn), (_flags), #_timer, &__key);\ @@ -101,7 +101,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, #_timer, &__key); \ } while (0) #else -#define __init_timer(_timer, _fn, _flags) \ +#define __timer_init(_timer, _fn, _flags) \ timer_init_key((_timer), (_fn), (_flags), NULL, NULL) #define __init_timer_on_stack(_timer, _fn, _flags) \ timer_init_key_on_stack((_timer), (_fn), (_flags), NULL, NULL) @@ -118,7 +118,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, * be used and must be balanced with a call to destroy_timer_on_stack(). */ #define timer_setup(timer, callback, flags) \ - __init_timer((timer), (callback), (flags)) + __timer_init((timer), (callback), (flags)) #define timer_setup_on_stack(timer, callback, flags) \ __init_timer_on_stack((timer), (callback), (flags)) -- cgit v1.2.3 From 9a716ac6eaaa73599921fa081c99b67bef589171 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:33 +0200 Subject: timers: Rename __init_timer_on_stack() as __timer_init_on_stack() Move this API to the canonical __timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-6-mingo@kernel.org --- include/linux/timer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 11e1fac18f0e..4e1237ff4b24 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -94,7 +94,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, timer_init_key((_timer), (_fn), (_flags), #_timer, &__key);\ } while (0) -#define __init_timer_on_stack(_timer, _fn, _flags) \ +#define __timer_init_on_stack(_timer, _fn, _flags) \ do { \ static struct lock_class_key __key; \ timer_init_key_on_stack((_timer), (_fn), (_flags), \ @@ -103,7 +103,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, #else #define __timer_init(_timer, _fn, _flags) \ timer_init_key((_timer), (_fn), (_flags), NULL, NULL) -#define __init_timer_on_stack(_timer, _fn, _flags) \ +#define __timer_init_on_stack(_timer, _fn, _flags) \ timer_init_key_on_stack((_timer), (_fn), (_flags), NULL, NULL) #endif @@ -121,7 +121,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, __timer_init((timer), (callback), (flags)) #define timer_setup_on_stack(timer, callback, flags) \ - __init_timer_on_stack((timer), (callback), (flags)) + __timer_init_on_stack((timer), (callback), (flags)) #ifdef CONFIG_DEBUG_OBJECTS_TIMERS extern void destroy_timer_on_stack(struct timer_list *timer); -- cgit v1.2.3 From 220beffd36c26ac68e1c646f91b7ddf4f39039e6 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:34 +0200 Subject: timers: Rename NEXT_TIMER_MAX_DELTA as TIMER_NEXT_MAX_DELTA Move this macro to the canonical TIMER_* namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-7-mingo@kernel.org --- include/linux/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 4e1237ff4b24..68cf8e28bbe0 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -156,7 +156,7 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires); * The jiffies value which is added to now, when there is no timer * in the timer wheel: */ -#define NEXT_TIMER_MAX_DELTA ((1UL << 30) - 1) +#define TIMER_NEXT_MAX_DELTA ((1UL << 30) - 1) extern void add_timer(struct timer_list *timer); extern void add_timer_local(struct timer_list *timer); -- cgit v1.2.3 From 751e6a394c2ecd08825d5ba527478e171b87144e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:35 +0200 Subject: timers: Rename init_timers() as timers_init() Move this API to the canonical timers_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-8-mingo@kernel.org --- include/linux/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 68cf8e28bbe0..153d07dad3cd 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -168,7 +168,7 @@ extern int timer_delete(struct timer_list *timer); extern int timer_shutdown_sync(struct timer_list *timer); extern int timer_shutdown(struct timer_list *timer); -extern void init_timers(void); +extern void timers_init(void); struct hrtimer; extern enum hrtimer_restart it_real_fn(struct hrtimer *); -- cgit v1.2.3 From 367ed4e35734d6e7bce1dbca426a5bf150d76905 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:36 +0200 Subject: treewide, timers: Rename try_to_del_timer_sync() as timer_delete_sync_try() Move this API to the canonical timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-9-mingo@kernel.org --- include/linux/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 153d07dad3cd..5b6ff90fcf81 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -162,7 +162,7 @@ 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 int try_to_del_timer_sync(struct timer_list *timer); +extern int timer_delete_sync_try(struct timer_list *timer); extern int timer_delete_sync(struct timer_list *timer); extern int timer_delete(struct timer_list *timer); extern int timer_shutdown_sync(struct timer_list *timer); -- cgit v1.2.3 From aad823aa3a7d675a8d0de478a04307f63e3725db Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Wed, 7 May 2025 19:53:37 +0200 Subject: treewide, timers: Rename destroy_timer_on_stack() as timer_destroy_on_stack() Move this API to the canonical timer_*() namespace. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250507175338.672442-10-mingo@kernel.org --- include/linux/timer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index 5b6ff90fcf81..7b53043a2d25 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -115,7 +115,7 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, * * Regular timer initialization should use either DEFINE_TIMER() above, * or timer_setup(). For timers on the stack, timer_setup_on_stack() must - * be used and must be balanced with a call to destroy_timer_on_stack(). + * be used and must be balanced with a call to timer_destroy_on_stack(). */ #define timer_setup(timer, callback, flags) \ __timer_init((timer), (callback), (flags)) @@ -124,9 +124,9 @@ static inline void timer_init_key_on_stack(struct timer_list *timer, __timer_init_on_stack((timer), (callback), (flags)) #ifdef CONFIG_DEBUG_OBJECTS_TIMERS -extern void destroy_timer_on_stack(struct timer_list *timer); +extern void timer_destroy_on_stack(struct timer_list *timer); #else -static inline void destroy_timer_on_stack(struct timer_list *timer) { } +static inline void timer_destroy_on_stack(struct timer_list *timer) { } #endif #define from_timer(var, callback_timer, timer_fieldname) \ -- cgit v1.2.3 From 41cb08555c4164996d67c78b3bf1c658075b75f1 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 9 May 2025 07:51:14 +0200 Subject: treewide, timers: Rename from_timer() to timer_container_of() Move this API to the canonical timer_*() namespace. [ tglx: Redone against pre rc1 ] Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/aB2X0jCKQO56WdMt@gmail.com --- include/linux/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/timer.h') diff --git a/include/linux/timer.h b/include/linux/timer.h index f636f55c427d..0414d9e6b4fc 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -129,7 +129,7 @@ extern void timer_destroy_on_stack(struct timer_list *timer); static inline void timer_destroy_on_stack(struct timer_list *timer) { } #endif -#define from_timer(var, callback_timer, timer_fieldname) \ +#define timer_container_of(var, callback_timer, timer_fieldname) \ container_of(callback_timer, typeof(*var), timer_fieldname) /** -- cgit v1.2.3