From ef0297b527130ce851c3cb2276fb2729a28b254c Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 18 Mar 2016 08:18:31 +0000 Subject: [PATCH] [libc] Allow container_of() to be used on volatile pointers Signed-off-by: Michael Brown --- src/include/stddef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/stddef.h b/src/include/stddef.h index 3c056294..fb01c489 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; } )