]> www.infradead.org Git - users/hch/misc.git/commitdiff
hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:55:17 +0000 (11:55 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 5 Apr 2025 08:30:17 +0000 (10:30 +0200)
The struct hrtimer::function field can only be changed using
hrtimer_setup*() or hrtimer_update_function(), and both already null-check
'function'. Therefore, null-checking 'function' in hrtimer_start_range_ns()
is not necessary.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/all/4661c571ee87980c340ccc318fc1a473c0c8f6bc.1738746927.git.namcao@linutronix.de
kernel/time/hrtimer.c

index 88ea4bbea9c1ee0e3e07e68b9c0b8987860a14c8..e883f65cd1751c58c0771bdc1cec73d8f003e56b 100644 (file)
@@ -1316,8 +1316,6 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
        struct hrtimer_clock_base *base;
        unsigned long flags;
 
-       if (WARN_ON_ONCE(!ACCESS_PRIVATE(timer, function)))
-               return;
        /*
         * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft
         * match on CONFIG_PREEMPT_RT = n. With PREEMPT_RT check the hard