From patchwork Fri Feb 27 11:51:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 5900281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DC939F38E for ; Fri, 27 Feb 2015 11:56:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94AB520272 for ; Fri, 27 Feb 2015 11:56:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A78BF201CD for ; Fri, 27 Feb 2015 11:56:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRJUu-0001wU-2f; Fri, 27 Feb 2015 11:54:24 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRJU6-0001VD-99 for linux-arm-kernel@lists.infradead.org; Fri, 27 Feb 2015 11:53:36 +0000 Received: by pdjy10 with SMTP id y10so20618677pdj.6 for ; Fri, 27 Feb 2015 03:53:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ABT22giCDo+rBjqNx6xxRHUyXYrGsWceWqAFw4iaGTg=; b=WRqjggdIr3Iz8Gc232iVuZ1gC7F/YF71paGk/7Mm+Jy6BohDCvF7Pa6hWtUFCM3a1p MdhWcgE2nGpA+tAuhZMZXl2hduSJtVzuZX4+3rgVyfqIOH8Rtls5B8npXDgFv0bMin08 31QquG85uj9GIQx5Uxw43GfPDYwMvyjIpn6TeaWIHGlFE9d5dBndeUBisI0LiQgXwUEJ XvuPTD/4Hb39iXgGn+Ewld5RE222C/ImlJri8Q+3ijFEP0TUUo6ZCdo+PfKRCfVydbBu tvIlpHE/NTV1+EQM81DWjlu8QkaibG5akI2UMO7ajZVI/iOaNZrc3+4HZWyuTnt03HMi ch6w== X-Gm-Message-State: ALoCoQmKcQGRsksico2wSob7mmyT1a6BYAzU+PumUjs6BRtHT0x0AEYhRjHZtM8nNaX7s+PbDXxJ X-Received: by 10.70.133.168 with SMTP id pd8mr23214327pdb.122.1425037993087; Fri, 27 Feb 2015 03:53:13 -0800 (PST) Received: from localhost ([122.178.228.114]) by mx.google.com with ESMTPSA id ia9sm3828308pbc.26.2015.02.27.03.53.11 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Feb 2015 03:53:12 -0800 (PST) From: Viresh Kumar To: Thomas Gleixner , Peter Zijlstra , Ingo Molnar Subject: [PATCH 3/3] clockevents: Don't validate dev->mode against CLOCK_EVT_MODE_UNUSED for new interface Date: Fri, 27 Feb 2015 17:21:34 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150227_035334_369001_592D8858 X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, Frederic Weisbecker , Daniel Lezcano , linux-kernel@vger.kernel.org, Kevin Hilman , Viresh Kumar , Preeti U Murthy , linaro-networking@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 6e53e9a0c2e8..73689df1e4b8 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 */