]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clockevents: Remove redundant CLOCK_EVT_FEAT_KTIME
authorThomas Gleixner <tglx@kernel.org>
Tue, 24 Feb 2026 16:36:15 +0000 (17:36 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 27 Feb 2026 15:40:06 +0000 (16:40 +0100)
The only real usecase for this is the hrtimer based broadcast device.
No point in using two different feature flags for this.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260224163429.609049777@kernel.org
include/linux/clockchips.h
kernel/time/clockevents.c
kernel/time/tick-broadcast-hrtimer.c

index b0df28ddd394be3cee7e6491e04d922471fc04d4..5e8f7819f6a617930de4afd32ffab0faf4641ec3 100644 (file)
@@ -45,7 +45,6 @@ enum clock_event_state {
  */
 # define CLOCK_EVT_FEAT_PERIODIC       0x000001
 # define CLOCK_EVT_FEAT_ONESHOT                0x000002
-# define CLOCK_EVT_FEAT_KTIME          0x000004
 
 /*
  * x86(64) specific (mis)features:
index eaae1ce9f0600777c17f53540393c7da3fc700b4..5abaeef08e6a9908cedc80fed25c781e23af24c5 100644 (file)
@@ -319,8 +319,8 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
        WARN_ONCE(!clockevent_state_oneshot(dev), "Current state: %d\n",
                  clockevent_get_state(dev));
 
-       /* Shortcut for clockevent devices that can deal with ktime. */
-       if (dev->features & CLOCK_EVT_FEAT_KTIME)
+       /* ktime_t based reprogramming for the broadcast hrtimer device */
+       if (unlikely(dev->features & CLOCK_EVT_FEAT_HRTIMER))
                return dev->set_next_ktime(expires, dev);
 
        delta = ktime_to_ns(ktime_sub(expires, ktime_get()));
index a88b72b0f35eeef9c9f5c1ce82249dbae67ab666..51f6a1032c83e40f2d7267e5ace1c448f0b2a476 100644 (file)
@@ -78,7 +78,6 @@ static struct clock_event_device ce_broadcast_hrtimer = {
        .set_state_shutdown     = bc_shutdown,
        .set_next_ktime         = bc_set_next,
        .features               = CLOCK_EVT_FEAT_ONESHOT |
-                                 CLOCK_EVT_FEAT_KTIME |
                                  CLOCK_EVT_FEAT_HRTIMER,
        .rating                 = 0,
        .bound_on               = -1,