From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966399AbbDVTOd (ORCPT ); Wed, 22 Apr 2015 15:14:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41709 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966356AbbDVTOZ (ORCPT ); Wed, 22 Apr 2015 15:14:25 -0400 Date: Wed, 22 Apr 2015 12:13:50 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, preeti@linux.vnet.ibm.com, mingo@kernel.org, fweisbec@gmail.com, tglx@linutronix.de, mtosatti@redhat.com, viresh.kumar@linaro.org Reply-To: tglx@linutronix.de, fweisbec@gmail.com, viresh.kumar@linaro.org, mtosatti@redhat.com, preeti@linux.vnet.ibm.com, mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <20150414203503.404751457@linutronix.de> References: <20150414203503.404751457@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] tick: broadcast-hrtimer: Remove overly clever return value abuse Git-Commit-ID: b8a62f1ff0ccb18fdc25c6150d1cd394610f4753 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b8a62f1ff0ccb18fdc25c6150d1cd394610f4753 Gitweb: http://git.kernel.org/tip/b8a62f1ff0ccb18fdc25c6150d1cd394610f4753 Author: Thomas Gleixner AuthorDate: Tue, 14 Apr 2015 21:09:22 +0000 Committer: Thomas Gleixner CommitDate: Wed, 22 Apr 2015 17:06:52 +0200 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 Reviewed-by: Preeti U Murthy Acked-by: Peter Zijlstra Cc: Viresh Kumar Cc: Marcelo Tosatti Cc: Frederic Weisbecker Link: http://lkml.kernel.org/r/20150414203503.404751457@linutronix.de Signed-off-by: Thomas Gleixner --- kernel/time/tick-broadcast-hrtimer.c | 8 +++++--- 1 file 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();