diff mbox

[for-next,v3,12/12] x86/pv/domain: clean up switch_compat

Message ID 20170426155457.10799-13-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu April 26, 2017, 3:54 p.m. UTC
Remove the redundant is_pv_domain check. Rearrange setup_compat calls.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/pv/domain.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Jan Beulich April 28, 2017, 8:51 a.m. UTC | #1
>>> On 26.04.17 at 17:54, <wei.liu2@citrix.com> wrote:
> Remove the redundant is_pv_domain check. Rearrange setup_compat calls.

Well, as said earlier, I don't really see the value of the latter, but
anyway ...

> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox

Patch

diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index a01e3516ca..f55d41587a 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -65,16 +65,12 @@  int switch_compat(struct domain *d)
         return 0;
 
     d->arch.has_32bit_shinfo = 1;
-    if ( is_pv_domain(d) )
-        d->arch.is_32bit_pv = 1;
+    d->arch.is_32bit_pv = 1;
 
     for_each_vcpu( d, v )
     {
-        rc = setup_compat_arg_xlat(v);
-        if ( !rc )
-            rc = setup_compat_l4(v);
-
-        if ( rc )
+        if ( (rc = setup_compat_arg_xlat(v)) ||
+             (rc = setup_compat_l4(v)) )
             goto undo_and_fail;
     }