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

Re: [Xen-devel] [RFC PATCH V3 03/12] xen/mem_paging: Convert mem_event_op to mem_paging_op



>>> On 29.01.15 at 22:46, <tamas.lengyel@xxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/mm/mem_paging.c
> +++ b/xen/arch/x86/mm/mem_paging.c
> @@ -25,31 +25,29 @@
>  #include <xen/mem_event.h>
>  
>  
> -int mem_paging_memop(struct domain *d, xen_mem_event_op_t *mec)
> +int mem_paging_memop(struct domain *d, xen_mem_paging_op_t *mpc)
>  {
>      if ( unlikely(!d->mem_event->paging.ring_page) )
>          return -ENODEV;
>  
> -    switch( mec->op )
> +    switch( mpc->op )
>      {
>      case XENMEM_paging_op_nominate:
>      {
> -        unsigned long gfn = mec->gfn;
> -        return p2m_mem_paging_nominate(d, gfn);
> +        return p2m_mem_paging_nominate(d, mpc->gfn);
>      }
>      break;
>  
>      case XENMEM_paging_op_evict:
>      {
> -        unsigned long gfn = mec->gfn;
> -        return p2m_mem_paging_evict(d, gfn);
> +        return p2m_mem_paging_evict(d, mpc->gfn);
>      }
>      break;
>  
>      case XENMEM_paging_op_prep:
>      {
> -        unsigned long gfn = mec->gfn;
> -        return p2m_mem_paging_prep(d, gfn, mec->buffer);
> +        unsigned long gfn = mpc->gfn;
> +        return p2m_mem_paging_prep(d, gfn, mpc->buffer);
>      }

So you nicely dropped the pointless local variables above, but not
here? Why? Also, where you drop them, please also drop the then
pointless figure braces.

> --- a/xen/arch/x86/x86_64/compat/mm.c
> +++ b/xen/arch/x86/x86_64/compat/mm.c
> @@ -188,11 +188,11 @@ int compat_arch_memory_op(unsigned long cmd, 
> XEN_GUEST_HANDLE_PARAM(void) arg)
>  
>      case XENMEM_paging_op:
>      {
> -        xen_mem_event_op_t meo;
> -        if ( copy_from_guest(&meo, arg, 1) )
> +        xen_mem_paging_op_t mpo;
> +        if ( copy_from_guest(&mpo, arg, 1) )

Please fix coding style issues in code you touch anyway: Here,
insert a blank line between declaration and first statement.

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