[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [for-4.7 v2 1/2] xen: XENMEM_add_to_physmap_batch: Mark 'foreign_id' as reserved for dev_mmio



>>> On 27.05.16 at 17:16, <julien.grall@xxxxxxx> wrote:
> On 27/05/16 10:58, Jan Beulich wrote:
>>>>> On 25.05.16 at 17:56, <julien.grall@xxxxxxx> wrote:
>>> --- a/xen/common/compat/memory.c
>>> +++ b/xen/common/compat/memory.c
>>> @@ -253,6 +253,8 @@ int compat_memory_op(unsigned int cmd, 
>>> XEN_GUEST_HANDLE_PARAM(void) compat)
>>>               unsigned int size = cmp.atpb.size;
>>>               xen_ulong_t *idxs = (void *)(nat.atpb + 1);
>>>               xen_pfn_t *gpfns = (void *)(idxs + limit);
>>> +            enum XLAT_add_to_physmap_batch_u u =
>>> +                XLAT_add_to_physmap_batch_u_res0;
>>
>> Here you're cheating, and to help future readers understand you are
>> you should say why this is okay in a comment. Or alternatively handle
>> things properly.
> 
> Well, this is the case on other place having to convert union (see 
> XENMEM_get_vnumainfo). So I though it was valid.

It depends on context whether you can go this way or need to use
switch().

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.