hrtimer: Move hrtimer_callback_running() to hrtimer_bases.h

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) <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260702-hrtimer-header-dependencies-v1-2-c50b19bda473@linutronix.de
This commit is contained in:
Thomas Weißschuh (Schneider Electric)
2026-07-07 23:43:44 +02:00
committed by Thomas Gleixner
parent 03b5d4c279
commit d3dc7fabd4
4 changed files with 13 additions and 9 deletions
-9
View File
@@ -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
+10
View File
@@ -2,6 +2,7 @@
#ifndef _LINUX_HRTIMER_BASES_H
#define _LINUX_HRTIMER_BASES_H
#include <linux/hrtimer.h>
#include <linux/ktime.h>
#include <linux/timerqueue.h>
#include <linux/seqlock.h>
@@ -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
+2
View File
@@ -26,6 +26,8 @@
#include <linux/jiffies.h>
#include <linux/mm_api.h>
#include <linux/highmem.h>
#include <linux/hrtimer.h>
#include <linux/hrtimer_bases.h>
#include <linux/spinlock_api.h>
#include <linux/cpumask_api.h>
#include <linux/lockdep_api.h>
+1
View File
@@ -13,6 +13,7 @@
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/hrtimer.h>
#include <linux/hrtimer_bases.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <sound/core.h>