x86: remove redundant checks in sysctl.c
PATCH 1/2 x86: remove redundant checks in sysctl.c
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.
--- xen/arch/x86/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/sysctl.c +2 -2
@@ -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 ; }
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 31.08.17 at 10:07, <[email protected]> wrote:
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.
Quoted 1 line
Signed-off-by Yi Sun <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Yi Sun
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.Signed-off-by Yi Sun <[email protected]>
Thanks!
BTW, the subject line says 1/2, but I cannot find 2/2, is that just a glitch?
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Roger Pau Monn�
Quoted 4 lines · Yi Sun
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.
Quoted 9 lines
Quoted 1 line
Signed-off-by Yi Sun <[email protected]>Thanks!
Reviewed-by Roger Pau Monn? <[email protected]>BTW, the subject line says 1/2, but I cannot find 2/2, is that just a glitch?
Oh, sorry, I just executed 'format-patch -2' to create 2 fix patches. But I sent them out one by one. I see you have found the second one. :)
Quoted 1 line
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel