From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757591Ab2FOVXI (ORCPT ); Fri, 15 Jun 2012 17:23:08 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:57688 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247Ab2FOVXF (ORCPT ); Fri, 15 Jun 2012 17:23:05 -0400 Date: Fri, 15 Jun 2012 14:22:13 -0700 From: "Paul E. McKenney" To: Josh Triplett Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, patches@linaro.org Subject: Re: [PATCH tip/core/rcu 04/14] rcu: Add a gcc-style structure initializer for RCU pointers Message-ID: <20120615212213.GL2389@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20120615201256.GA26120@linux.vnet.ibm.com> <1339791195-26389-1-git-send-email-paulmck@linux.vnet.ibm.com> <1339791195-26389-4-git-send-email-paulmck@linux.vnet.ibm.com> <20120615204813.GI31184@leaf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120615204813.GI31184@leaf> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061521-4242-0000-0000-000001FB3803 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2012 at 01:48:14PM -0700, Josh Triplett wrote: > On Fri, Jun 15, 2012 at 01:13:05PM -0700, Paul E. McKenney wrote: > > From: "Paul E. McKenney" > > > > RCU_INIT_POINTER() returns a value that is never used, and which should > > be abolished due to terminal ugliness: > > > > q = RCU_INIT_POINTER(global_p, p); > > > > However, there are two uses that cannot be handled by a do-while > > formulation because they do gcc-style initialization: > > > > RCU_INIT_POINTER(.real_cred, &init_cred), > > RCU_INIT_POINTER(.cred, &init_cred), > > > > This usage is clever, but not necessarily the nicest approach. This > > commit therefore creates an INIT_RCU_POINTER() macro that is specifically > > designed for gcc-style initialization. > > The concept seems fine, but the names seem entirely non-obvious. > RCU_INIT_POINTER versus INIT_RCU_POINTER? I was following things like INIT_THREAD_INFO(), with the leading "INIT_" for gcc initialization. Thanx, Paul