lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150212082359.GJ2896@worktop.programming.kicks-ass.net>
Date:	Thu, 12 Feb 2015 09:23:59 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Viresh Kumar <viresh.kumar@...aro.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Kevin Hilman <khilman@...aro.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Linaro Networking <linaro-networking@...aro.org>
Subject: Re: [PATCH] clockevents: Introduce mode specific callbacks

On Thu, Feb 12, 2015 at 09:09:30AM +0800, Viresh Kumar wrote:
> On 11 February 2015 at 18:38, Peter Zijlstra <peterz@...radead.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ