Skip to content

Commit

Permalink
hrtimers: Merge __hrtimer_init() into __hrtimer_setup()
Browse files Browse the repository at this point in the history
__hrtimer_init() is only called by __hrtimer_setup(). Simplify by merging
__hrtimer_init() into __hrtimer_setup().

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/8a0a847a35f711f66b2d05b57255aa44e7e61279.1738746927.git.namcao@linutronix.de
  • Loading branch information
Nam Cao authored and Ingo Molnar committed Apr 5, 2025
1 parent 50177a8 commit 87d82cf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions kernel/time/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,8 +1592,9 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id)
}
}

static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
enum hrtimer_mode mode)
static void __hrtimer_setup(struct hrtimer *timer,
enum hrtimer_restart (*function)(struct hrtimer *),
clockid_t clock_id, enum hrtimer_mode mode)
{
bool softtimer = !!(mode & HRTIMER_MODE_SOFT);
struct hrtimer_cpu_base *cpu_base;
Expand Down Expand Up @@ -1626,13 +1627,6 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
timer->is_hard = !!(mode & HRTIMER_MODE_HARD);
timer->base = &cpu_base->clock_base[base];
timerqueue_init(&timer->node);
}

static void __hrtimer_setup(struct hrtimer *timer,
enum hrtimer_restart (*function)(struct hrtimer *),
clockid_t clock_id, enum hrtimer_mode mode)
{
__hrtimer_init(timer, clock_id, mode);

if (WARN_ON_ONCE(!function))
timer->function = hrtimer_dummy_timeout;
Expand Down

0 comments on commit 87d82cf

Please sign in to comment.