[PATCH v2 08/12] hrtimers: Remove unnecessary NULL check in hrtimer_start_range_ns()

From: Nam Cao
Date: Wed Feb 05 2025 - 06:05:04 EST


The 'function' field of struct hrtimer 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@xxxxxxxxxxxxx>
---
kernel/time/hrtimer.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 027a63344259..4878a2c7e4bd 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1326,8 +1326,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
--
2.39.5