[tip: timers/core] hrtimer: Mark index and clockid of clock base as const
From: tip-bot2 for Thomas Weißschuh (Schneider Electric)
Date: Thu Mar 12 2026 - 07:32:47 EST
The following commit has been merged into the timers/core branch of tip:
Commit-ID: f12ef5cb4e035e15f0c324c41ff402441578ffda
Gitweb: https://git.kernel.org/tip/f12ef5cb4e035e15f0c324c41ff402441578ffda
Author: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@xxxxxxxxxxxxx>
AuthorDate: Wed, 11 Mar 2026 11:15:19 +01:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Thu, 12 Mar 2026 12:15:55 +01:00
hrtimer: Mark index and clockid of clock base as const
These fields are initialized once and are never supposed to change.
Mark them as const to make this explicit.
Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@xxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20260311-hrtimer-cleanups-v1-10-095357392669@xxxxxxxxxxxxx
---
include/linux/hrtimer_defs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/hrtimer_defs.h b/include/linux/hrtimer_defs.h
index e6d4dc1..a03240c 100644
--- a/include/linux/hrtimer_defs.h
+++ b/include/linux/hrtimer_defs.h
@@ -26,8 +26,8 @@
*/
struct hrtimer_clock_base {
struct hrtimer_cpu_base *cpu_base;
- unsigned int index;
- clockid_t clockid;
+ const unsigned int index;
+ const clockid_t clockid;
seqcount_raw_spinlock_t seq;
ktime_t expires_next;
struct hrtimer *running;