x86: remove redundant checks in sysctl.c
authorYi Sun <yi.y.sun@linux.intel.com>
Thu, 31 Aug 2017 08:07:26 +0000 (16:07 +0800)
committerWei Liu <wei.liu2@citrix.com>
Thu, 31 Aug 2017 15:34:11 +0000 (16:34 +0100)
In sysctl.c, the return value of 'psr_get_info' has been checked immediately.
So, it is redundant to check the return value again when copy the field to
guest.

Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/sysctl.c

index 2bde99c3c425d8b9661a72f9b196063e92aed405..c3fdae81d1247f5d660697dd90c732928c86e694 100644 (file)
@@ -190,7 +190,7 @@ long arch_do_sysctl(
             sysctl->u.psr_cat_op.u.cat_info.flags =
                                       data[PSR_INFO_IDX_CAT_FLAG];
 
-            if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
+            if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
                 ret = -EFAULT;
             break;
         }
@@ -209,7 +209,7 @@ long arch_do_sysctl(
             sysctl->u.psr_cat_op.u.cat_info.flags =
                                       data[PSR_INFO_IDX_CAT_FLAG];
 
-            if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
+            if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_cat_op) )
                 ret = -EFAULT;
             break;
         }