From b194c06ef206b0fcf7f1e646fe7c1e8afa8766ce Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 23 Aug 2011 17:22:00 -0400 Subject: [PATCH] Document caa_container_of Signed-off-by: Mathieu Desnoyers --- urcu/compiler.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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)); \ }) -- 2.34.1