]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hrtimer: Mark index and clockid of clock base as const
authorThomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
Wed, 11 Mar 2026 10:15:19 +0000 (11:15 +0100)
committerThomas Gleixner <tglx@kernel.org>
Thu, 12 Mar 2026 11:15:55 +0000 (12:15 +0100)
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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260311-hrtimer-cleanups-v1-10-095357392669@linutronix.de
include/linux/hrtimer_defs.h

index e6d4dc1b61e0f5609e30bdc2f26a493d771c7540..a03240c0b14f8f56dd58b4330d8184c75b905092 100644 (file)
@@ -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;