From 736f30b8b14e996320a7444d1203a97a49ba96bb Mon Sep 17 00:00:00 2001 From: "J. Avila" Date: Sat, 1 Aug 2020 19:15:07 +0000 Subject: [PATCH] ANDROID: GKI: kernel: tick-sched: Move wake callback registration code The code to register a wakeup callback exists outside of the #ifdef CONFIG_HIGH_RES_TIMERS which actually uses it, causing compilation errors. Move it inside the block, where it belongs. Bug: 162654685 Fixes: 4c3d3d24ddc4 ("kernel: tick-sched: Add an API for wakeup callbacks") Change-Id: I3876481c71d63f4cc655280bdd183024b70897c8 Signed-off-by: J. Avila --- kernel/time/tick-sched.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index f8256bb66bfa..77c359d58817 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1262,6 +1262,15 @@ void tick_irq_enter(void) static void (*wake_callback)(void); +void register_tick_sched_wakeup_callback(void (*cb)(void)) +{ + if (!wake_callback) + wake_callback = cb; + else + pr_warn("tick-sched wake cb already exists; skipping.\n"); +} +EXPORT_SYMBOL_GPL(register_tick_sched_wakeup_callback); + /* * We rearm the timer until we get disabled by the idle code. * Called with interrupts disabled. @@ -1404,15 +1413,6 @@ int tick_check_oneshot_change(int allow_nohz) return 0; } -void register_tick_sched_wakeup_callback(void (*cb)(void)) -{ - if (!wake_callback) - wake_callback = cb; - else - pr_warn("tick-sched wake cb already exists; skipping.\n"); -} -EXPORT_SYMBOL_GPL(register_tick_sched_wakeup_callback); - ktime_t *get_next_event_cpu(unsigned int cpu) { return &(per_cpu(tick_cpu_device, cpu).evtdev->next_event);