From: Michael Brown Date: Fri, 18 Mar 2016 08:18:31 +0000 (+0000) Subject: [libc] Allow container_of() to be used on volatile pointers X-Git-Tag: v1.20.1~515 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef0297b527130ce851c3cb2276fb2729a28b254c;p=thirdparty%2Fipxe.git [libc] Allow container_of() to be used on volatile pointers Signed-off-by: Michael Brown --- diff --git a/src/include/stddef.h b/src/include/stddef.h index 3c056294f..fb01c489d 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -34,7 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ #define container_of( ptr, type, field ) ( { \ type *__container; \ - const typeof ( __container->field ) *__field = (ptr); \ + const volatile typeof ( __container->field ) *__field = (ptr); \ __container = ( ( ( void * ) __field ) - \ offsetof ( type, field ) ); \ __container; } )