diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-04-14 21:09:22 +0000 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-04-22 17:06:52 +0200 |
commit | b8a62f1ff0ccb18fdc25c6150d1cd394610f4753 (patch) | |
tree | bed49ac252fa973581fe52b611bceafe0ba3d48f /kernel/time/tick-broadcast-hrtimer.c | |
parent | b193217e6dc3f88b599b573b53e0e0f6671d969a (diff) | |
download | op-kernel-dev-b8a62f1ff0ccb18fdc25c6150d1cd394610f4753.zip op-kernel-dev-b8a62f1ff0ccb18fdc25c6150d1cd394610f4753.tar.gz |
tick: broadcast-hrtimer: Remove overly clever return value abuse
The assignment of bc_moved in the conditional construct relies on the
fact that in the case of hrtimer_start() invocation the return value
is always 0. It took me a while to understand it.
We want to get rid of the hrtimer_start() return value. Open code the
logic which makes it readable as well.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20150414203503.404751457@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/tick-broadcast-hrtimer.c')
-rw-r--r-- | kernel/time/tick-broadcast-hrtimer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c index 6aac4be..96428d7 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c @@ -66,9 +66,11 @@ static int bc_set_next(ktime_t expires, struct clock_event_device *bc) * hrtimer_{start/cancel} functions call into tracing, * calls to these functions must be bound within RCU_NONIDLE. */ - RCU_NONIDLE(bc_moved = (hrtimer_try_to_cancel(&bctimer) >= 0) ? - !hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED) : - 0); + RCU_NONIDLE({ + bc_moved = hrtimer_try_to_cancel(&bctimer) >= 0; + if (bc_moved) + hrtimer_start(&bctimer, expires, + HRTIMER_MODE_ABS_PINNED);}); if (bc_moved) { /* Bind the "device" to the cpu */ bc->bound_on = smp_processor_id(); |