]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/p2m: use available local variable in guest_physmap_add_entry()
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Apr 2020 15:17:29 +0000 (17:17 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Apr 2020 15:17:29 +0000 (17:17 +0200)
The domain is being passed in - no need to obtain it from p2m->domain.
Also drop a pointless cast and simplify expressions while touching this
code anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm/p2m.c

index 51b9e2584d9da0e0ec2f620b5ce2580f9c2022c5..d6e9a4d2795c4c4945b5280afe6c1d0df486fbfa 100644 (file)
@@ -902,7 +902,7 @@ guest_physmap_add_entry(struct domain *d, gfn_t gfn, mfn_t mfn,
         if ( p2m_is_shared(ot) )
         {
             /* Do an unshare to cleanly take care of all corner cases. */
-            rc = mem_sharing_unshare_page(p2m->domain, gfn_x(gfn_add(gfn, i)));
+            rc = mem_sharing_unshare_page(d, gfn_x(gfn) + i);
             if ( rc )
             {
                 p2m_unlock(p2m);
@@ -919,8 +919,7 @@ guest_physmap_add_entry(struct domain *d, gfn_t gfn, mfn_t mfn,
                  * Foreign domains are okay to place an event as they
                  * won't go to sleep.
                  */
-                (void)mem_sharing_notify_enomem(p2m->domain,
-                                                gfn_x(gfn_add(gfn, i)), false);
+                mem_sharing_notify_enomem(d, gfn_x(gfn) + i, false);
                 return rc;
             }
             omfn = p2m->get_entry(p2m, gfn_add(gfn, i),