From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753793AbbC0Ltn (ORCPT ); Fri, 27 Mar 2015 07:49:43 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37480 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbbC0Lti (ORCPT ); Fri, 27 Mar 2015 07:49:38 -0400 Date: Fri, 27 Mar 2015 04:49:02 -0700 From: tip-bot for Viresh Kumar Message-ID: Cc: preeti@linux.vnet.ibm.com, khilman@linaro.org, a.p.zijlstra@chello.nl, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, viresh.kumar@linaro.org, daniel.lezcano@linaro.org, fweisbec@gmail.com Reply-To: fweisbec@gmail.com, daniel.lezcano@linaro.org, mingo@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, khilman@linaro.org, a.p.zijlstra@chello.nl, preeti@linux.vnet.ibm.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] clockevents: Don't validate dev-> mode against CLOCK_EVT_MODE_UNUSED for new interface Git-Commit-ID: de81e64b250d3865a75d221a80b4311e3273670a 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: de81e64b250d3865a75d221a80b4311e3273670a Gitweb: http://git.kernel.org/tip/de81e64b250d3865a75d221a80b4311e3273670a Author: Viresh Kumar AuthorDate: Fri, 27 Feb 2015 17:21:34 +0530 Committer: Ingo Molnar CommitDate: Fri, 27 Mar 2015 10:26:20 +0100 clockevents: Don't validate dev->mode against CLOCK_EVT_MODE_UNUSED for new interface It was a requirement in the legacy interface that drivers must initialize ->mode field to 'CLOCK_EVT_MODE_UNUSED'. This field isn't used anymore by the new interface and so should be only checked for the legacy interface. Probably it can be dropped as well as core doesn't rely on it anymore, but lets keep it to support legacy interface. Signed-off-by: Viresh Kumar Acked-by: Peter Zijlstra Cc: Daniel Lezcano Cc: Frederic Weisbecker Cc: Kevin Hilman Cc: Peter Zijlstra Cc: Preeti U Murthy Cc: linaro-kernel@lists.linaro.org Cc: linaro-networking@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/c6604fa1a77fe1fc8dcab87769857228fb1dadd5.1425037853.git.viresh.kumar@linaro.org Signed-off-by: Ingo Molnar --- kernel/time/clockevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 6e53e9a..73689df 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -450,6 +450,8 @@ static int clockevents_sanity_check(struct clock_event_device *dev) /* We shouldn't be supporting new modes now */ WARN_ON(dev->set_state_periodic || dev->set_state_oneshot || dev->set_state_shutdown || dev->tick_resume); + + BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); return 0; } @@ -479,7 +481,6 @@ void clockevents_register_device(struct clock_event_device *dev) { unsigned long flags; - BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); BUG_ON(clockevents_sanity_check(dev)); /* Initialize state to DETACHED */