[alsa-devel] [PATCH v2 3/3] topology: A API calls to directly build topology data from templates

Takashi Iwai tiwai at suse.de
Tue Aug 11 10:18:01 CEST 2015


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


More information about the Alsa-devel mailing list