lkml.org 
[lkml]   [2009]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] kernel/{sched,smp}.c: fix static decl prior to struct declaration

* Jeff Garzik <jeff@garzik.org> wrote:

> According to C99 6.9.2p3, any declaration "static struct foo my_foo;"
> must follow the definition of struct foo.
>
> Apparently, gcc's lack of warning is a bug.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

good spotting, i'll apply this fix, but:

> */
> struct task_group root_task_group;
>
> -#ifdef CONFIG_FAIR_GROUP_SCHED
> -/* Default task group's sched entity on each cpu */
> -static DEFINE_PER_CPU(struct sched_entity, init_sched_entity);
> -/* Default task group's cfs_rq on each cpu */
> -static DEFINE_PER_CPU(struct cfs_rq, init_cfs_rq) ____cacheline_aligned_in_smp;
> -#endif /* CONFIG_FAIR_GROUP_SCHED */
> -
> -#ifdef CONFIG_RT_GROUP_SCHED
> -static DEFINE_PER_CPU(struct sched_rt_entity, init_sched_rt_entity);
> -static DEFINE_PER_CPU(struct rt_rq, init_rt_rq) ____cacheline_aligned_in_smp;
> -#endif /* CONFIG_RT_GROUP_SCHED */
> -#else /* !CONFIG_USER_SCHED */
> -#define root_task_group init_task_group
> -#endif /* CONFIG_USER_SCHED */
> -
> /* task_group_lock serializes add/remove of task groups and also changes to

This block has a visible imbalance of preprocessor directives -
there's a #else you moved, without moving the outermost #ifdef. My
guess is that this will go down in a fireball with
CONFIG_GROUP_SCHED disabled?

Ingo


\
 
 \ /
  Last update: 2009-05-08 21:09    [W:0.119 / U:3.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site