[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Feb 2011 10:55:06 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Richard Cochran <richardcochran@...il.com>
cc: LKML <linux-kernel@...r.kernel.org>,
John Stultz <john.stultz@...aro.org>,
Richard Cochran <richard.cochran@...cron.at>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch 12/28] posix-timers: Convert clock_gettime() to
clockid_to_kclock()
On Wed, 2 Feb 2011, Richard Cochran wrote:
> On Tue, Feb 01, 2011 at 01:51:50PM -0000, Thomas Gleixner wrote:
> > --- linux-2.6-tip.orig/kernel/posix-timers.c
> > +++ linux-2.6-tip/kernel/posix-timers.c
>
> > @@ -956,18 +955,21 @@ SYSCALL_DEFINE2(clock_settime, const clo
> > SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
> > struct timespec __user *,tp)
> > {
> > + struct k_clock *kc = clockid_to_kclock(which_clock);
> > struct timespec kernel_tp;
> > int error;
> >
> > - if (invalid_clockid(which_clock))
> > + if (!kc)
> > return -EINVAL;
> > - error = CLOCK_DISPATCH(which_clock, clock_get,
> > - (which_clock, &kernel_tp));
> > + if (!kc->clock_get)
> > + return -EOPNOTSUPP;
>
> An unreadable clock?
>
> I would think that we can require k_clocks to provide the read
> function. This could be checked and enforced in register_posix_clock().
Fair enough. Though, we should do that in a separate step.
Thanks,
tglx
--
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