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

Re: [Xen-devel] [PATCH v1] x86/hvm: Clean up the rest of bool_t from vm_event



>>> On 29.10.18 at 11:54, <aisaila@xxxxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1905,7 +1905,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned 
> long gla,
>      if ( sharing_enomem )
>      {
>          int rv;
> -        if ( (rv = mem_sharing_notify_enomem(currd, gfn, 1)) < 0 )
> +        if ( (rv = mem_sharing_notify_enomem(currd, gfn, true)) < 0 )

May I encourage you to make trivial style corrections when you
touch a piece of code anyway (here: add a missing blank line
ahead of the line you change). It's fine to restrict this to just
code you actually change, i.e. it's generally preferable if you
don't change lines you don't touch anyway.

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -448,7 +448,7 @@ mfn_t __get_gfn_type_access(struct p2m_domain *p2m, 
> unsigned long gfn_l,
>          /* Try to unshare. If we fail, communicate ENOMEM without
>           * sleeping. */
>          if ( mem_sharing_unshare_page(p2m->domain, gfn_l, 0) < 0 )
> -            (void)mem_sharing_notify_enomem(p2m->domain, gfn_l, 0);
> +            (void)mem_sharing_notify_enomem(p2m->domain, gfn_l, false);

Same here then (pointless cast could be dropped).

> @@ -840,7 +840,7 @@ guest_physmap_add_entry(struct domain *d, gfn_t gfn, 
> mfn_t mfn,
>                   * won't go to sleep. */
>                  (void)mem_sharing_notify_enomem(p2m->domain,
>                                                  gfn_x(gfn_add(gfn, i)),
> -                                                0);
> +                                                false);
>                  return rc;

Whereas this is an example where I personally wouldn't drop the
cast, but I'd consider combining the last two lines.

> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -356,7 +356,7 @@ int guest_remove_page(struct domain *d, unsigned long 
> gmfn)
>          rc = mem_sharing_unshare_page(d, gmfn, 0);
>          if ( rc )
>          {
> -            (void)mem_sharing_notify_enomem(d, gmfn, 0);
> +            (void)mem_sharing_notify_enomem(d, gmfn, false);

Pointless cast should be dropped again.


With these adjustments
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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