[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.

With that fixed:

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks!



 


Rackspace

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