At the moment, write_atomic() will happily write to a pointer to const.
While there are no use in Xen, it would be best to catch them at
compilation time.
Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
#define write_atomic(p, x) ({ \
typeof(*(p)) __x = (x); \
+ /* Check that the pointer is not a const type */ \
+ void *__maybe_unused p_ = &__x; \
unsigned long x_ = (unsigned long)__x; \
switch ( sizeof(*(p)) ) { \
case 1: write_u8_atomic((uint8_t *)(p), x_); break; \