Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[libc] Allow container_of() to be used on volatile pointers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 18, 2016
1 parent 04ef198 commit ef0297b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/stddef.h
Expand Up @@ -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; } )
Expand Down

0 comments on commit ef0297b

Please sign in to comment.