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

Re: [Xen-devel] [PATCH] xen/x86: Remove unnecessary cast on void pointer





On Sat, Mar 28, 2020 at 4:28 PM Wei Liu <wl@xxxxxxx> wrote:
On Sat, Mar 28, 2020 at 11:18:40AM +0100, Roger Pau Monné wrote:
> Thanks!
>
> On Sat, Mar 28, 2020 at 11:08:35AM +0530, Simran Singhal wrote:
> > diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> > index f049920196..a53d3ca2a4 100644
> > --- a/xen/arch/x86/hvm/vmx/vvmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> > @@ -256,7 +256,7 @@ static int vvmcs_offset(u32 width, u32 type, u32 index)
> >  u64 get_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding)
> >  {
> >      union vmcs_encoding enc;
> > -    u64 *content = (u64 *) vvmcs;
> > +    u64 *content = vvmcs;
> >      int offset;
> >      u64 res;
> > 
> > @@ -310,7 +310,7 @@ enum vmx_insn_errno get_vvmcs_real_safe(const struct vcpu *v, u32 encoding,
> >  void set_vvmcs_virtual(void *vvmcs, u32 vmcs_encoding, u64 val)
> >  {
> >      union vmcs_encoding enc;
> > -    u64 *content = (u64 *) vvmcs;
> > +    u64 *content = vvmcs;
>
> While there, would you mind changing u64 to uint64_t? (here and
> above)
>

To add some context to this comment: new code has been using uintX
variants. We want to migrate existing code gradually. Since you're
touching these lines anyway, it is a good chance to do the migration.

When you do this in your next version, please add a line in the commit
message saying something along the line that "Take the chance to change
some u64 to uint64_t".

Thanks for the suggestion. I'll do the changes in the next version.

Thanks
Simran
 

Wei.

 


Rackspace

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