david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[libc] Allow container_of() to be used on volatile pointers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2016-03-18 08:18:31 +00:00
parent 04ef198d2f
commit ef0297b527
1 changed files with 1 additions and 1 deletions

View 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; } )