[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/2] x86: slightly simplify PHYSDEVOP_pirq_eoi_gmfn_v* handling
We don't really need the MFN in more than one place (after dropping mfn_to_page() translations where we know the result already), so no need to have a local variable for it. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -336,7 +336,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H case PHYSDEVOP_pirq_eoi_gmfn_v2: case PHYSDEVOP_pirq_eoi_gmfn_v1: { struct physdev_pirq_eoi_gmfn info; - unsigned long mfn; struct page_info *page; ret = -EFAULT; @@ -352,21 +351,20 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H put_page(page); break; } - mfn = page_to_mfn(page); if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, - 0, mfn) != 0 ) + 0, page_to_mfn(page)) != 0 ) { - put_page_and_type(mfn_to_page(mfn)); + put_page_and_type(page); ret = -EBUSY; break; } - v->domain->arch.pirq_eoi_map = map_domain_page_global(mfn); + v->domain->arch.pirq_eoi_map = __map_domain_page_global(page); if ( v->domain->arch.pirq_eoi_map == NULL ) { v->domain->arch.pirq_eoi_map_mfn = 0; - put_page_and_type(mfn_to_page(mfn)); + put_page_and_type(page); ret = -ENOSPC; break; } Attachment:
x86-pirq-eoi-gmfn-simplify.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |