From: Takashi Iwai Subject: Re: [PATCH v2 3/3] topology: A API calls to directly build topology data from templates Date: Tue, 11 Aug 2015 10:18:01 +0200 Message-ID: References: <1439230429-6173-1-git-send-email-liam.r.girdwood@linux.intel.com> <1439230429-6173-4-git-send-email-liam.r.girdwood@linux.intel.com> <1439280288.2427.5.camel@loki> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 86D0A2604B3 for ; Tue, 11 Aug 2015 10:18:02 +0200 (CEST) In-Reply-To: <1439280288.2427.5.camel@loki> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Liam Girdwood Cc: Mengdong Lin , alsa-devel@alsa-project.org, Mark Brown List-Id: alsa-devel@alsa-project.org On Tue, 11 Aug 2015 10:04:48 +0200, Liam Girdwood wrote: > > On Tue, 2015-08-11 at 09:57 +0200, Takashi Iwai wrote: > > > @@ -34,6 +34,10 @@ > > > #define ALSA_TPLG_DIR ALSA_CONFIG_DIR "/topology" > > > #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) > > > > > > +#define container_of(ptr, type, member) ({ \ > > > + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > + (type *)( (char *)__mptr - offsetof(type,member) );}) > > > > This is a pretty common macro, so I prefer having it in > > include/local.h. > > I'll also move ARRAY_SIZE() to local.h too since it's common. Sounds reasonable. thanks, Takashi