lkml.org 
[lkml]   [2019]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V2 17/38] posix-cpu-timers: Create a container struct
On Wed, Aug 21, 2019 at 09:09:04PM +0200, Thomas Gleixner wrote:
> --- a/include/linux/posix-timers.h
> +++ b/include/linux/posix-timers.h
> @@ -62,6 +62,40 @@ static inline int clockid_to_fd(const cl
> return ~(clk >> 3);
> }

Shouldn't you start the #ifdef CONFIG_POSIX_TIMERS here?
Because you're redefining struct posix_cputimers otherwise.

> +/**
> + * posix_cputimers - Container for posix CPU timer related data
> + * @cpu_timers: List heads to queue posix CPU timers
> + *
> + * Used in task_struct and signal_struct
> + */
> +struct posix_cputimers {
> + struct list_head cpu_timers[CPUCLOCK_MAX];
> +};
> +
> +static inline void posix_cputimers_init(struct posix_cputimers *pct)
> +{
> + INIT_LIST_HEAD(&pct->cpu_timers[0]);
> + INIT_LIST_HEAD(&pct->cpu_timers[1]);
> + INIT_LIST_HEAD(&pct->cpu_timers[2]);
> +}
> +
> +#ifdef CONFIG_POSIX_TIMERS
> +/* Init task static initializer */
> +#define INIT_CPU_TIMERLISTS(c) { \
> + LIST_HEAD_INIT(c.cpu_timers[0]), \
> + LIST_HEAD_INIT(c.cpu_timers[1]), \
> + LIST_HEAD_INIT(c.cpu_timers[2]), \
> +}
> +
> +#define INIT_CPU_TIMERS(s) \
> + .posix_cputimers = { \
> + .cpu_timers = INIT_CPU_TIMERLISTS(s.posix_cputimers), \
> + },
> +#else
> +struct posix_cputimers { };
> +#define INIT_CPU_TIMERS(s)
> +#endif
> +

Other than that:

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>

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