Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754830Ab0KHQmr (ORCPT ); Mon, 8 Nov 2010 11:42:47 -0500 Received: from www.tglx.de ([62.245.132.106]:41169 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754789Ab0KHQmp (ORCPT ); Mon, 8 Nov 2010 11:42:45 -0500 Date: Mon, 8 Nov 2010 17:42:01 +0100 (CET) From: Thomas Gleixner To: Darren Hart cc: linux-kernel@vger.kernel.org, Matt Fleming , peterz@infradead.org, mingo@elte.hu, eric.dumazet@gmail.com, jkacur@redhat.com, Darren Hart Subject: Re: [PATCH 3/3] futex: add futex_q static initializer In-Reply-To: <1288216466-14309-4-git-send-email-dvhart@linux.intel.com> Message-ID: References: <1288216466-14309-1-git-send-email-dvhart@linux.intel.com> <1288216466-14309-4-git-send-email-dvhart@linux.intel.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1473 Lines: 45 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 > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: Ingo Molnar > CC: Eric Dumazet > CC: John Kacur > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/