public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Richard Cochran <richardcochran@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	netdev@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Arnd Bergmann <arnd@arndb.de>, Christoph Lameter <cl@linux.com>,
	David Miller <davem@davemloft.net>,
	John Stultz <johnstul@us.ibm.com>,
	Krzysztof Halasa <khc@pm.waw.pl>,
	Peter Zijlstra <peterz@infradead.org>,
	Rodolfo Giometti <giometti@linux.it>
Subject: Re: [PATCH V9 08/13] posix clocks: cleanup the CLOCK_DISPTACH macro
Date: Thu, 13 Jan 2011 18:03:24 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1101131745400.2678@localhost6.localdomain6> (raw)
In-Reply-To: <90b2beef441615d01c93fcad029c44af4e505c5f.1294917348.git.richard.cochran@omicron.at>

On Thu, 13 Jan 2011, Richard Cochran wrote:
>  int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
>  int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
> -int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
> +int posix_cpu_clock_set(const clockid_t which_clock, struct timespec *ts);

Shouldn't we change the clock_set function to have *ts const in all places ?

>  static int posix_ktime_get_ts(clockid_t which_clock, struct timespec *tp)
> @@ -279,12 +230,29 @@ static __init int init_posix_timers(void)
>  {
>  	struct k_clock clock_realtime = {
>  		.clock_getres = hrtimer_get_res,
> +		/* defaults: */
> +		.clock_adj	= common_clock_adj,
> +		.clock_get	= common_clock_get,
> +		.clock_set	= common_clock_set,
> +		.nsleep		= common_nsleep,
> +		.nsleep_restart	= common_nsleep_restart,
> +		.timer_create	= common_timer_create,
> +		.timer_del	= common_timer_del,
> +		.timer_get	= common_timer_get,
> +		.timer_set	= common_timer_set,
>  	};
>  	struct k_clock clock_monotonic = {
>  		.clock_getres = hrtimer_get_res,
>  		.clock_get = posix_ktime_get_ts,
>  		.clock_set = do_posix_clock_nosettime,
>  		.clock_adj = do_posix_clock_noadjtime,
> +		/* defaults: */
> +		.nsleep		= common_nsleep,
> +		.nsleep_restart	= common_nsleep_restart,
> +		.timer_create	= common_timer_create,
> +		.timer_del	= common_timer_del,
> +		.timer_get	= common_timer_get,
> +		.timer_set	= common_timer_set,
>  	};
>  	struct k_clock clock_monotonic_raw = {
>  		.clock_getres = hrtimer_get_res,
> @@ -293,6 +261,11 @@ static __init int init_posix_timers(void)
>  		.clock_adj = do_posix_clock_noadjtime,
>  		.timer_create = no_timer_create,
>  		.nsleep = no_nsleep,
> +		/* defaults: */
> +		.nsleep_restart	= common_nsleep_restart,
> +		.timer_del	= common_timer_del,
> +		.timer_get	= common_timer_get,
> +		.timer_set	= common_timer_set,

Hmm, we do not need to set functional entries for clocks which neither
implement timer_create nor nsleep.

Otherwise I really like the outcome. :)

Thanks for your patience !

       tglx

  reply	other threads:[~2011-01-13 17:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 11:31 [PATCH V9 00/13] ptp: IEEE 1588 hardware clock support Richard Cochran
2011-01-13 11:31 ` [PATCH V9 01/13] time: Introduce timekeeping_inject_offset Richard Cochran
2011-01-13 11:32 ` [PATCH V9 02/13] ntp: add ADJ_SETOFFSET mode bit Richard Cochran
2011-01-13 20:39   ` Kuwahara,T.
2011-01-13 20:57     ` john stultz
2011-01-13 21:52       ` john stultz
2011-01-13 11:32 ` [PATCH V9 03/13] posix clocks: introduce a syscall for clock tuning Richard Cochran
2011-01-13 11:32 ` [PATCH V9 04/13] posix_clocks: add clock_adjtime for arm Richard Cochran
2011-01-13 11:33 ` [PATCH V9 05/13] posix_clocks: add clock_adjtime for blackfin Richard Cochran
2011-01-13 11:33 ` [PATCH V9 06/13] posix_clocks: add clock_adjtime for powerpc Richard Cochran
2011-01-13 11:33 ` [PATCH V9 07/13] posix_clocks: add clock_adjtime for x86 Richard Cochran
2011-01-13 11:35 ` [PATCH V9 08/13] posix clocks: cleanup the CLOCK_DISPTACH macro Richard Cochran
2011-01-13 17:03   ` Thomas Gleixner [this message]
2011-01-14  7:48     ` Richard Cochran
2011-01-14  9:31       ` Thomas Gleixner
2011-01-22 12:38     ` Richard Cochran
2011-01-22 12:42       ` Thomas Gleixner
2011-01-13 11:35 ` [PATCH V9 09/13] posix clocks: introduce dynamic clocks Richard Cochran
2011-01-13 11:35 ` [PATCH V9 10/13] ptp: Added a brand new class driver for ptp clocks Richard Cochran
2011-01-13 11:35 ` [PATCH V9 11/13] ptp: Added a clock that uses the eTSEC found on the MPC85xx Richard Cochran
2011-01-13 11:36 ` [PATCH V9 12/13] ptp: Added a clock driver for the IXP46x Richard Cochran
2011-01-13 11:36 ` [PATCH V9 13/13] ptp: Added a clock driver for the National Semiconductor PHYTER Richard Cochran

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=alpine.LFD.2.00.1101131745400.2678@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=giometti@linux.it \
    --cc=johnstul@us.ibm.com \
    --cc=khc@pm.waw.pl \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=richardcochran@gmail.com \
    /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