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

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Aug 11 10:04:48 CEST 2015


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.

Liam



More information about the Alsa-devel mailing list