lkml.org 
[lkml]   [2019]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@linutronix.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@kernel.org>

\
 
 \ /
  Last update: 2019-08-22 01:40    [W:1.993 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site