]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Allow container_of() to be used on volatile pointers
authorMichael Brown <mcb30@ipxe.org>
Fri, 18 Mar 2016 08:18:31 +0000 (08:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 18 Mar 2016 08:18:31 +0000 (08:18 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/stddef.h

index 3c056294faafcfdf3ada3adcb2564035405d961e..fb01c489d8acdee6d547d77f80067ec707464fcb 100644 (file)
@@ -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; } )