[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190821234024.GE22020@lenoir>
Date: Thu, 22 Aug 2019 01:40:25 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
John Stultz <john.stultz@...aro.org>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Christoph Hellwig <hch@....de>
Subject: Re: [patch V2 02/38] posix-cpu-timers: Use common permission check
in posix_cpu_clock_get()
On Wed, Aug 21, 2019 at 09:08:49PM +0200, Thomas Gleixner wrote:
> Replace the next slightly different copy of permission checks. That also
> removes the necessarity to check the return value of the sample functions
> because the clock id is already validated.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> kernel/time/posix-cpu-timers.c | 61 ++++++++++-------------------------------
> 1 file changed, 16 insertions(+), 45 deletions(-)
>
> --- a/kernel/time/posix-cpu-timers.c
> +++ b/kernel/time/posix-cpu-timers.c
> @@ -289,53 +289,24 @@ static int cpu_clock_sample_group(const
> return 0;
> }
>
> -static int posix_cpu_clock_get_task(struct task_struct *tsk,
> - const clockid_t which_clock,
> - struct timespec64 *tp)
> +static int posix_cpu_clock_get(const clockid_t clock, struct timespec64 *tp)
> {
> - int err = -EINVAL;
> - u64 rtn;
> + const clockid_t clkid = CPUCLOCK_WHICH(clock);
So I guess you later remove the CPUCLOCK_WHICH() from cpu_clock_sample*()
and turn them to void.
Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Powered by blists - more mailing lists