summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2017-01-07 23:01:28 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2017-01-07 23:01:28 +0000
commit775f0188376cf52ff78e07a7574792cb78a0b9f2 (patch)
treebaaa6e1a98890538be82e880bcdab34b510118dc /sys
parent06cb64cfafce9f5db35b6735d8fc9d3908311276 (diff)
reduce statement nesting depth in a couple places, suggested by
Michael Bombardieri
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/vmm.c13
-rw-r--r--sys/arch/i386/i386/vmm.c13
2 files changed, 14 insertions, 12 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index ae88e40d4d4..7fe8bbcbd6f 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.100 2017/01/07 22:37:03 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.101 2017/01/07 23:01:27 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -1216,11 +1216,12 @@ vcpu_reload_vmcs_vmx(uint64_t *vmcs)
uint64_t old;
/* Flush any old state */
- if (!vmptrst(&old)) {
- if (old != 0xFFFFFFFFFFFFFFFFULL) {
- if (vmclear(&old))
- return (EINVAL);
- }
+ if (vmptrst(&old))
+ return (EINVAL);
+
+ if (old != 0xFFFFFFFFFFFFFFFFULL) {
+ if (vmclear(&old))
+ return (EINVAL);
} else
return (EINVAL);
diff --git a/sys/arch/i386/i386/vmm.c b/sys/arch/i386/i386/vmm.c
index 0aeaec60e2b..d72d9b86e69 100644
--- a/sys/arch/i386/i386/vmm.c
+++ b/sys/arch/i386/i386/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.6 2017/01/07 22:39:16 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.7 2017/01/07 23:01:27 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -1220,11 +1220,12 @@ vcpu_reload_vmcs_vmx(uint64_t *vmcs)
uint64_t old;
/* Flush any old state */
- if (!vmptrst(&old)) {
- if (old != 0xFFFFFFFFFFFFFFFFULL) {
- if (vmclear(&old))
- return (EINVAL);
- }
+ if (vmptrst(&old))
+ return (EINVAL);
+
+ if (old != 0xFFFFFFFFFFFFFFFFULL) {
+ if (vmclear(&old))
+ return (EINVAL);
} else
return (EINVAL);