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@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2015-01-20 10:45:01 +01:00
1 parent 7991cca9b3
commit 0e5e324db9
1 file changed
+4 -6
+4 -6
View File
@@ -336,7 +336,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
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_HANDLE_PARAM(void) arg)
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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.