diff mbox

[36/38] tick-broadcast: get rid of extra comparison in tick_do_broadcast_on_off()

Message ID c20bfe318b69821078bcd8d0d55126dc6b6f0d26.1397492345.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar April 14, 2014, 4:23 p.m. UTC
We are doing an extra comparison in tick_do_broadcast_on_off():

               if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE)
                       tick_broadcast_force = 1;

Whereas it can be handled easily in the switch block only.

It doesn't look like there is any strict ordering of instructions required here
and so move setting 'tick_broadcast_force' at the beginning.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/time/tick-broadcast.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 3b07569..ec86227 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -348,15 +348,14 @@  static void tick_do_broadcast_on_off(unsigned long *reason)
 	bc_stopped = cpumask_empty(tick_broadcast_mask);
 
 	switch (*reason) {
-	case CLOCK_EVT_NOTIFY_BROADCAST_ON:
 	case CLOCK_EVT_NOTIFY_BROADCAST_FORCE:
+		tick_broadcast_force = 1;
+	case CLOCK_EVT_NOTIFY_BROADCAST_ON:
 		cpumask_set_cpu(cpu, tick_broadcast_on);
 		if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_mask)) {
 			if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
 				clockevents_shutdown(dev);
 		}
-		if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE)
-			tick_broadcast_force = 1;
 		break;
 	case CLOCK_EVT_NOTIFY_BROADCAST_OFF:
 		if (tick_broadcast_force)