From patchwork Thu Feb 12 01:09:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 44577 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED2E921527 for ; Thu, 12 Feb 2015 01:09:39 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id k11sf4367919wes.3 for ; Wed, 11 Feb 2015 17:09:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=Ec8R0cZHDPmeyJ5ueFeBhrdxvaJBqDSBeaaa8UfYaG4=; b=EbfsvoGpwy3LxNbQ0NVf7Vjr41XIYSFgz+tQFY4gYHgsW3uDm+EI01FJltygfxVE81 etYqWp94Xv073DlzXtDTpDfQtH6xL/VsfbJLPXiVCGOYMOcD92Wtc9Eeyv6SYs73Vr3H CajC+jdB/nPx0MBm78tc0hk/91SkOyJM7OWRF1FHPyk1+1DPtrVzoqFCINQq5RZ/fPTf s2zfb8Z2iuwgq5G324CsYSSHoa6gcp9N18tfT/dLSwfKXsrtCxXq9Fmjq6K0nTiIyBu9 48aqJcPUIwINeKXo/j85m8M9ljBUTKotHZdyXUcYkjxcuVMCnPNbakK0e7XBXi86SMHI N4wA== X-Gm-Message-State: ALoCoQlroVV8kaH/bVr5qwaSocnNXK+e49Zn/5qo4F31yKZsAXNYLZy96Pf38DQ+mcV2B62ZWQsd X-Received: by 10.112.99.37 with SMTP id en5mr160077lbb.17.1423703379130; Wed, 11 Feb 2015 17:09:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.170 with SMTP id d10ls122662lad.37.gmail; Wed, 11 Feb 2015 17:09:38 -0800 (PST) X-Received: by 10.152.204.73 with SMTP id kw9mr1177433lac.16.1423703378762; Wed, 11 Feb 2015 17:09:38 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id dp5si772446lac.128.2015.02.11.17.09.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 17:09:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id b6so6615063lbj.12 for ; Wed, 11 Feb 2015 17:09:38 -0800 (PST) X-Received: by 10.152.5.167 with SMTP id t7mr1223246lat.32.1423703378503; Wed, 11 Feb 2015 17:09:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp137060lbj; Wed, 11 Feb 2015 17:09:37 -0800 (PST) X-Received: by 10.66.100.230 with SMTP id fb6mr2152879pab.156.1423703376631; Wed, 11 Feb 2015 17:09:36 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tq6si3059990pac.52.2015.02.11.17.09.35; Wed, 11 Feb 2015 17:09:36 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754610AbbBLBJc (ORCPT + 28 others); Wed, 11 Feb 2015 20:09:32 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:64332 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753741AbbBLBJb (ORCPT ); Wed, 11 Feb 2015 20:09:31 -0500 Received: by mail-oi0-f51.google.com with SMTP id g201so611960oib.10 for ; Wed, 11 Feb 2015 17:09:30 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.114.40 with SMTP id jd8mr1050483oeb.12.1423703370854; Wed, 11 Feb 2015 17:09:30 -0800 (PST) Received: by 10.182.33.34 with HTTP; Wed, 11 Feb 2015 17:09:30 -0800 (PST) In-Reply-To: <20150211103845.GR23123@twins.programming.kicks-ass.net> References: <025ca1872df9ed8a9f7b6e0400e71ed296374183.1423034839.git.viresh.kumar@linaro.org> <20150210141541.GB7119@twins.programming.kicks-ass.net> <20150211103845.GR23123@twins.programming.kicks-ass.net> Date: Thu, 12 Feb 2015 09:09:30 +0800 Message-ID: Subject: Re: [PATCH] clockevents: Introduce mode specific callbacks From: Viresh Kumar To: Peter Zijlstra Cc: Thomas Gleixner , Linaro Kernel Mailman List , Linux Kernel Mailing List , Kevin Hilman , Frederic Weisbecker , Preeti U Murthy , Daniel Lezcano , Linaro Networking Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 11 February 2015 at 18:38, Peter Zijlstra wrote: > I think its better to be strict; esp. with new interfaces. It avoids > confusion. > > Suppose a driver writer sees these new methods and thinks to use one > while still having the set_mode() one -- ie. he didn't actually read the > comment. We'd better make sure he fails and goes back to read it. Okay, does below diff looks good to you ? --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index e646fbe44b05..75d221c7e9cc 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -444,8 +444,12 @@ EXPORT_SYMBOL_GPL(clockevents_unbind); static int clockevents_sanity_check(struct clock_event_device *dev) { /* Legacy set_mode() callback */ - if (dev->set_mode) + if (dev->set_mode) { + /* We shouldn't be supporting new modes now */ + WARN_ON(dev->set_mode_periodic || dev->set_mode_oneshot || + dev->set_mode_shutdown || dev->set_mode_resume); return 0; + } if (dev->features & CLOCK_EVT_FEAT_DUMMY) return 0;