lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 36/38] tick-broadcast: get rid of extra comparison in tick_do_broadcast_on_off()
Date
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 --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)
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-04-15 11:41    [W:0.134 / U:72.856 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site