| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: [Xen-devel] [PATCH v2] xen/x86: Remove unnecessary cast on void pointer
 
 
 On Sun, Mar 29, 2020 at 10:25:12AM +0530, Simran Singhal wrote:> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
 > index f049920196..2edb103205 100644
 > --- a/xen/arch/x86/hvm/vmx/vvmx.c
 > +++ b/xen/arch/x86/hvm/vmx/vvmx.c
 > @@ -253,12 +253,12 @@ static int vvmcs_offset(u32 width, u32 type, u32 index)
 >      return offset;
 >  }
 >
 > -u64 get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
 > +uint64_t get_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding)
 >  {
 >      union vmcs_encoding enc;
 > -    u64 *content = (u64 *) vvmcs;
 > +    uint64_t *content = vvmcs;
 >      int offset;
 > -    u64 res;
 > +    uint64_t res;
 >
 >      enc.word = vmcs_encoding;
 >      offset = vvmcs_offset(enc.width, enc.type, enc.index);
 > @@ -307,12 +307,12 @@ enum vmx_insn_errno get_vvmcs_real_safe(const struct vcpu *v, u32 encoding,
 >      return virtual_vmcs_vmread_safe(v, encoding, val);
 >  }
 >
 > -void set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
 > +void set_vvmcs_virtual(void *vvmcs, uint32_t vmcs_encoding, uint64_t val)
 >  {
 >      union vmcs_encoding enc;
 > -    u64 *content = (u64 *) vvmcs;
 > +    uint64_t *content = vvmcs;
 >      int offset;
 > -    u64 res;
 > +    uint64_t res;
 
 Thanks for doing the switch of content to type uint64_t. You should
 however not change the type of res to uint64_t also IMO, as you are
 not touching that line anyway.
 
 
 Thanks for your feedback Roger and Wei. My bad, I thought I need to change all the unintX to uintX_t in the function set_vvmcs_virtual(). 
 Sorry for the inconvenience.
   
With that fixed:
 
 Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
 
 Thanks!
 
 |