From: Mathieu Desnoyers Date: Tue, 23 Aug 2011 21:22:00 +0000 (-0400) Subject: Document caa_container_of X-Git-Tag: v0.6.5~42 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b194c06ef206b0fcf7f1e646fe7c1e8afa8766ce;p=userspace-rcu.git Document caa_container_of Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/compiler.h b/urcu/compiler.h index 489677b..f8fce5a 100644 --- a/urcu/compiler.h +++ b/urcu/compiler.h @@ -55,9 +55,16 @@ #define CAA_BITS_PER_LONG 32 #endif -#define caa_container_of(ptr, type, member) \ +/* + * caa_container_of - Get the address of an object containing a field. + * + * @ptr: pointer to the field. + * @type: type of the object. + * @member: name of the field within the object. + */ +#define caa_container_of(ptr, type, member) \ ({ \ - const typeof(((type *)NULL)->member) * __ptr = (ptr); \ + const typeof(((type *) NULL)->member) * __ptr = (ptr); \ (type *)((char *)__ptr - offsetof(type, member)); \ })