From: Peter Zijlstra <peterz@infradead.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Linaro Kernel Mailman List <linaro-kernel@lists.linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Kevin Hilman <khilman@linaro.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Linaro Networking <linaro-networking@linaro.org>
Subject: Re: [PATCH] clockevents: Introduce mode specific callbacks
Date: Thu, 12 Feb 2015 09:23:59 +0100 [thread overview]
Message-ID: <20150212082359.GJ2896@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKohpo=0cG1Bo8NgcrMVTLo=bDnUoD-R8fY5XKT=22X8bzRv2A@mail.gmail.com>
On Thu, Feb 12, 2015 at 09:09:30AM +0800, Viresh Kumar wrote:
> On 11 February 2015 at 18:38, Peter Zijlstra <peterz@infradead.org> 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 ?
>
> 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;
Yep, that looks entirely reasonable.
prev parent reply other threads:[~2015-02-12 8:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 7:36 Viresh Kumar
2015-02-10 14:15 ` Peter Zijlstra
2015-02-11 3:24 ` Viresh Kumar
2015-02-11 10:38 ` Peter Zijlstra
2015-02-12 1:09 ` Viresh Kumar
2015-02-12 8:23 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150212082359.GJ2896@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=daniel.lezcano@linaro.org \
--cc=fweisbec@gmail.com \
--cc=khilman@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linaro-networking@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®