There's nothing wrong with having e.g.
copy_to_guest(uarg, ptr++, 1);
yet until now this would increment "ptr" twice.
Also drop a pair of unneeded parentheses from every instance at this
occasion.
Fixes: b7954cc59831 ("Enhance guest memory accessor macros so that source operands can be")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
/* Check that the handle is not for a const type */ \
void *__maybe_unused _t = (hnd).p; \
- ((void)((hnd).p == (ptr))); \
+ (void)((hnd).p == _s); \
raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \
})
#define copy_field_to_guest(hnd, ptr, field) ({ \
const typeof(&(ptr)->field) _s = &(ptr)->field; \
void *_d = &(hnd).p->field; \
- ((void)(&(hnd).p->field == &(ptr)->field)); \
+ (void)(&(hnd).p->field == _s); \
raw_copy_to_guest(_d, _s, sizeof(*_s)); \
})
char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
/* Check that the handle is not for a const type */ \
void *__maybe_unused _t = (hnd).p; \
- ((void)((hnd).p == (ptr))); \
+ (void)((hnd).p == _s); \
__raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\
})
#define __copy_field_to_guest(hnd, ptr, field) ({ \
const typeof(&(ptr)->field) _s = &(ptr)->field; \
void *_d = &(hnd).p->field; \
- ((void)(&(hnd).p->field == &(ptr)->field)); \
+ (void)(&(hnd).p->field == _s); \
__raw_copy_to_guest(_d, _s, sizeof(*_s)); \
})
char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
/* Check that the handle is not for a const type */ \
void *__maybe_unused _t = (hnd).p; \
- ((void)((hnd).p == (ptr))); \
+ (void)((hnd).p == _s); \
raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr)); \
})
#define copy_field_to_guest(hnd, ptr, field) ({ \
const typeof(&(ptr)->field) _s = &(ptr)->field; \
void *_d = &(hnd).p->field; \
- ((void)(&(hnd).p->field == &(ptr)->field)); \
+ (void)(&(hnd).p->field == _s); \
raw_copy_to_guest(_d, _s, sizeof(*_s)); \
})
char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \
/* Check that the handle is not for a const type */ \
void *__maybe_unused _t = (hnd).p; \
- ((void)((hnd).p == (ptr))); \
+ (void)((hnd).p == _s); \
__raw_copy_to_guest(_d+(off), _s, sizeof(*_s)*(nr));\
})
#define __copy_field_to_guest(hnd, ptr, field) ({ \
const typeof(&(ptr)->field) _s = &(ptr)->field; \
void *_d = &(hnd).p->field; \
- ((void)(&(hnd).p->field == &(ptr)->field)); \
+ (void)(&(hnd).p->field == _s); \
__raw_copy_to_guest(_d, _s, sizeof(*_s)); \
})