11 Aug
2015
11 Aug
'15
11:18 a.m.
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