x86/pv/domain: clean up switch_compat
authorWei Liu <wei.liu2@citrix.com>
Wed, 26 Apr 2017 15:28:37 +0000 (16:28 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 7 Jun 2017 11:15:56 +0000 (12:15 +0100)
Remove the redundant is_pv_domain check. Rearrange setup_compat calls.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/pv/domain.c

index 4bd65819f77d8145d55f4d9b8af92f2c450014c8..1c0c040ca0854ce0443b1d90bf44a2b719cff150 100644 (file)
@@ -60,16 +60,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;
     }