From d3dc7fabd4c4a3baaa7e7bfa84558fedad699580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh=20=28Schneider=20Electric=29?= Date: Thu, 2 Jul 2026 11:41:59 +0200 Subject: [PATCH] hrtimer: Move hrtimer_callback_running() to hrtimer_bases.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The usage of the hrtimer base introduces a dependency on the timer base structure definitions from the widely-used hrtimer.h. Move the helper to hrtimer_bases.h to trim this dependency. Also adapt the two only callers to now include hrtimer_bases.h. Signed-off-by: Thomas Weißschuh (Schneider Electric) Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-2-c50b19bda473@linutronix.de --- include/linux/hrtimer.h | 9 --------- include/linux/hrtimer_bases.h | 10 ++++++++++ kernel/sched/fair.c | 2 ++ sound/drivers/dummy.c | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 8aa58520a816..7bf154cf3079 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -287,15 +287,6 @@ static inline bool hrtimer_is_queued(struct hrtimer *timer) return READ_ONCE(timer->is_queued); } -/* - * Helper function to check, whether the timer is running the callback - * function - */ -static inline int hrtimer_callback_running(struct hrtimer *timer) -{ - return timer->base->running == timer; -} - /** * hrtimer_update_function - Update the timer's callback function * @timer: Timer to update diff --git a/include/linux/hrtimer_bases.h b/include/linux/hrtimer_bases.h index 8c10f45dc469..70b99e651168 100644 --- a/include/linux/hrtimer_bases.h +++ b/include/linux/hrtimer_bases.h @@ -2,6 +2,7 @@ #ifndef _LINUX_HRTIMER_BASES_H #define _LINUX_HRTIMER_BASES_H +#include #include #include #include @@ -110,4 +111,13 @@ struct hrtimer_cpu_base { } ____cacheline_aligned; +/* + * Helper function to check, whether the timer is running the callback + * function + */ +static inline int hrtimer_callback_running(struct hrtimer *timer) +{ + return timer->base->running == timer; +} + #endif diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d78467ec6ee1..09197f8e4b76 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 7283f0f18813..ce7ab986dee6 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include