>>> On 16.07.18 at 11:18, <wei.l...@citrix.com> wrote:
> On Fri, Jul 13, 2018 at 09:03:08PM +0100, Andrew Cooper wrote:
>> +#include <errno.h>
>>  #include <inttypes.h>
>>  #include <stdbool.h>
>>  #include <stddef.h>
>> @@ -23,6 +28,19 @@ static inline bool test_bit(unsigned int bit, const void 
> *vaddr)
>>      return addr[bit / 8] & (1u << (bit % 8));
>>  }
>>  
>> +/* memcpy(), but with copy_to_guest_offset()'s API. */
>> +#define copy_to_buffer_offset(dst, index, src, nr)      \
>> +({                                                      \
>> +    const typeof(*(dst)) *src_ = (src);                 \
> 
> I think you mean typeof(*(src)) here?

To follow copy_to_guest_offset()'s model there's more needed here,
I think: dst and src want to point to similar type objects / arrays (i.e.
the macro wants to enforce this).

I also notice that some of the now-local-variables are now pointlessly
parenthesized.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to