clockevents: Move the tick_notify() switch case to clockevents_notify()
authorThomas Gleixner <tglx@linutronix.de>
Thu, 25 Apr 2013 20:31:48 +0000 (20:31 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 21 Jan 2015 21:54:18 +0000 (21:54 +0000)
No need to call another function and have duplicated cases.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130425143436.235746557@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 8c53daf63f56791ed47fc585206ef3049489612f)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
kernel/time/tick-common.c

kernel/time/clockevents.c
kernel/time/tick-common.c
kernel/time/tick-internal.h

index dd70b4842c620caa1f77c10a71a1d1ff0e68ed33..0e3a8448e1155991b9973082ab40bd13b6b0a177 100644 (file)
@@ -404,10 +404,36 @@ void clockevents_notify(unsigned long reason, void *arg)
        int cpu;
 
        raw_spin_lock_irqsave(&clockevents_lock, flags);
-       tick_notify(reason, arg);
 
        switch (reason) {
+       case CLOCK_EVT_NOTIFY_BROADCAST_ON:
+       case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
+       case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
+               tick_broadcast_on_off(reason, arg);
+               break;
+
+       case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
+       case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
+               tick_broadcast_oneshot_control(reason);
+               break;
+
+       case CLOCK_EVT_NOTIFY_CPU_DYING:
+               tick_handover_do_timer(arg);
+               break;
+
+       case CLOCK_EVT_NOTIFY_SUSPEND:
+               tick_suspend();
+               tick_suspend_broadcast();
+               break;
+
+       case CLOCK_EVT_NOTIFY_RESUME:
+               tick_resume();
+               break;
+
        case CLOCK_EVT_NOTIFY_CPU_DEAD:
+               tick_shutdown_broadcast_oneshot(arg);
+               tick_shutdown_broadcast(arg);
+               tick_shutdown(arg);
                /*
                 * Unregister the clock event devices which were
                 * released from the users in the notify chain.
index dbf4e18d51013e3be6a8bfbc7f2eaac4f9338f9e..e5d6c4cdeba94402dd4eb172bab45c8c8f70a17c 100644 (file)
@@ -290,7 +290,7 @@ out_bc:
  *
  * Called with interrupts disabled.
  */
-static void tick_handover_do_timer(int *cpup)
+void tick_handover_do_timer(int *cpup)
 {
        if (*cpup == tick_do_timer_cpu) {
                int cpu = cpumask_first(cpu_online_mask);
@@ -307,7 +307,7 @@ static void tick_handover_do_timer(int *cpup)
  * access the hardware device itself.
  * We just set the mode and remove it from the lists.
  */
-static void tick_shutdown(unsigned int *cpup)
+void tick_shutdown(unsigned int *cpup)
 {
        struct tick_device *td = &per_cpu(tick_cpu_device, *cpup);
        struct clock_event_device *dev = td->evtdev;
@@ -328,7 +328,7 @@ static void tick_shutdown(unsigned int *cpup)
        raw_spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
-static void tick_suspend(void)
+void tick_suspend(void)
 {
        struct tick_device *td = &__get_cpu_var(tick_cpu_device);
        unsigned long flags;
@@ -338,7 +338,7 @@ static void tick_suspend(void)
        raw_spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
-static void tick_resume(void)
+void tick_resume(void)
 {
        struct tick_device *td = &__get_cpu_var(tick_cpu_device);
        unsigned long flags;
@@ -356,45 +356,6 @@ static void tick_resume(void)
        raw_spin_unlock_irqrestore(&tick_device_lock, flags);
 }
 
-void tick_notify(unsigned long reason, void *dev)
-{
-       switch (reason) {
-
-       case CLOCK_EVT_NOTIFY_BROADCAST_ON:
-       case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
-       case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
-               tick_broadcast_on_off(reason, dev);
-               break;
-
-       case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
-       case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
-               tick_broadcast_oneshot_control(reason);
-               break;
-
-       case CLOCK_EVT_NOTIFY_CPU_DYING:
-               tick_handover_do_timer(dev);
-               break;
-
-       case CLOCK_EVT_NOTIFY_CPU_DEAD:
-               tick_shutdown_broadcast_oneshot(dev);
-               tick_shutdown_broadcast(dev);
-               tick_shutdown(dev);
-               break;
-
-       case CLOCK_EVT_NOTIFY_SUSPEND:
-               tick_suspend();
-               tick_suspend_broadcast();
-               break;
-
-       case CLOCK_EVT_NOTIFY_RESUME:
-               tick_resume();
-               break;
-
-       default:
-               break;
-       }
-}
-
 /**
  * tick_init - initialize the tick control
  */
index 60742fe6f63de49e3e1d5e8c87dadfb7c7198e11..06bfc8802dfbd91973d337650fb620d8503a5ff7 100644 (file)
@@ -18,8 +18,11 @@ extern int tick_do_timer_cpu __read_mostly;
 
 extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
 extern void tick_handle_periodic(struct clock_event_device *dev);
-extern void tick_notify(unsigned long reason, void *dev);
 extern void tick_check_new_device(struct clock_event_device *dev);
+extern void tick_handover_do_timer(int *cpup);
+extern void tick_shutdown(unsigned int *cpup);
+extern void tick_suspend(void);
+extern void tick_resume(void);
 
 extern void clockevents_shutdown(struct clock_event_device *dev);