Messages in this thread | | | Date | Mon, 8 Nov 2010 17:42:01 +0100 (CET) | From | Thomas Gleixner <> | Subject | Re: [PATCH 3/3] futex: add futex_q static initializer |
| |
On Wed, 27 Oct 2010, Darren Hart wrote:
> The futex_q struct has grown considerably over the last couple years. I > believe it now merits a static initializer to avoid uninitialized data > errors (having spent more time than I care to admit debugging an uninitialized > q.bitset in an experimental new op code). > > With the key initializer built in, several of the FUTEX_KEY_INIT calls can > be removed. > > Signed-off-by: Darren Hart <dvhltc@us.ibm.com> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Ingo Molnar <mingo@elte.hu> > CC: Eric Dumazet <eric.dumazet@gmail.com> > CC: John Kacur <jkacur@redhat.com> > --- > kernel/futex.c | 25 ++++++++++--------------- > 1 files changed, 10 insertions(+), 15 deletions(-) > > diff --git a/kernel/futex.c b/kernel/futex.c > index 8502498..4a10d44 100644 > --- a/kernel/futex.c > +++ b/kernel/futex.c > @@ -131,6 +131,12 @@ struct futex_q { > u32 bitset; > }; > > +#define FUTEX_Q_INIT \ > + { /* list gets initialized in queue_me()*/ \ > + .task = NULL, NULL, FUTEX_KEY_INIT \ > + , NULL, NULL, NULL, FUTEX_BITSET_MATCH_ANY } > +
That should be a static readonly variable with a proper C99 initializer.
Thanks,
tglx
| |